xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ckn...@onebox.com
Subject RE: Re: Help with table-of-contents:don't understand ref-id attribute
Date Fri, 03 Mar 2006 17:15:41 GMT
Here is a trimmed-down model of the XML.
<test-case-documents>
  <directory @name="dir-1">
    <directory @name="dir-1-1">
      <file>
        <name>TC_01</name>
        ...... More elements here ......
      </file>
    </directory>
  </directory>
<test-case-documents>

This is the template in question:

  <xsl:template match="file" mode="toc">
    <fo:block text-align-last="justify">
      <fo:in-line>
        <value-of select="name" />
        <fo:leader leader-pattern="dots" />
        <fo:page-number-citation ref-id="{name}" />
      </fo:in-line>
    </fo:block>
  </xsl:template>

Here is where I invoke the template:

<xsl:template match="/">
   ..... XSLT goes here ....
<fo:page-sequence master-reference="matrix">
  <xsl:apply-templates select="test-case-documents/directory//file" mode="toc" />
</fo:page-sequence>
   ..... even more XSLT goes here ....
</xsl:template>

When I apply-templates, the context node is a "file", no?
As you can see, "name" is a child of "file" and I assert the value of each "name" is unique
throughout the document.

Thanks for your interest.
-- 
Charles Knell
cknell@onebox.com - email



-----Original Message-----
From:     Jay Bryant <jay@bryantcs.com>
Sent:     Fri, 3 Mar 2006 10:58:21 -0600
To:       <fop-users@xmlgraphics.apache.org>
Subject:  Re: Help with table-of-contents:don't understand ref-id attribute

Hi, Charles,

It is certainly true that the value of ref-id can be an element rather than
an attribute. It doesn't even necessarily have to be a child of the element
whose page number you want. I've bumped into XML that had ref values as
top-level elements next to the heading elements. Of course, either an
attribute or a child element makes for much nicer XSL.

My first thought is that you have a context issue: The name node must be a
child of the current context node. Unless you've used a for-each or some
other structure to force the context to be the heading (or whatever) for
which you are trying to get a page number, the processor can never find that
node. I know you are a regular on the Mulberry XSLT list, though, so I bet
you have already accounted for that possibility.

Can you post some of your XML source and the relevent parts of your
stylesheet or make a trimmed-down demonstration of the problem? If so, I'll
be happy to try to help figure out the problem.

Jay Bryant
Bryant Communication Services


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message