You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by ck...@onebox.com on 2006/03/03 19:36:07 UTC
RE: RE: Re: Help with table-of-contents:don't understand ref-id
attribute
I found my errors. Naturally they weren't where I was looking, but I was distracted by my unfamiliarity with the table of contents piece. I had a missing element, a mis-spelled element name, and I omitted a namespace part of another element.
Now the only problem I seem to have is that fop.bat won't terminate when it tells me it's "..., stopping renderer".
Thanks.
--
Charles Knell
cknell@onebox.com - email
-----Original Message-----
From: cknell@onebox.com
Sent: Fri, 03 Mar 2006 12:15:41 -0500
To: fop-users@xmlgraphics.apache.org
Subject: RE: Re: Help with table-of-contents:don't understand ref-id attribute
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 <ja...@bryantcs.com>
Sent: Fri, 3 Mar 2006 10:58:21 -0600
To: <fo...@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
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org