xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jay Bryant" <...@bryantcs.com>
Subject Re: Help with table-of-contents:don't understand ref-id attribute
Date Fri, 03 Mar 2006 19:36:16 GMT
Hi, Charles,

For ref-id to work, there has to be a corresponding id attribute somewhere.

So, some other template should be creating something like

<fo:block id="TC_01">Content here</fo:block>

Of course, you're probably doing that (no way to know from what I've seen so
far). I'd check to make sure that whatever template is supposed to do that
is doing the right thing. To do that, examine the FO file and see what shows
up.

HTH

Jay Bryant
Bryant Communication Services


----- Original Message ----- 
From: <cknell@onebox.com>
To: <fop-users@xmlgraphics.apache.org>
Sent: Friday, March 03, 2006 1:06 PM
Subject: Re: Help with table-of-contents:don't understand ref-id attribute


> I'm back. Just when I thought it was safe to go back into the water ....
(cue bass violin and muted trumpets);
>
> fop 0.20.5 is processing the XSL-FO document without complaint. I've still
got some minor formatting issues to deal with, but I have one huge problem,
no page numbers appear in the PDF file.
>
> Here is one of the relevant elements from the XSL-FO document's table of
contents section:
>
> <fo:block text-align-last="justify" text-indent="-1em" start-indent="1em">
>   <fo:inline padding-start="1em">TC_01<fo:leader leader-pattern="dots"/>
>    <fo:page-number-citation ref-id="TC_01"/>
>    </fo:inline>
> </fo:block>
>
> This is what the PDF looks like:
>
>                                              Table of Contents
>
TC_01.......................................................................
...................................................
>
TC_02.......................................................................
...................................................
> etc.
>
> Can anyone tell me where my page numbers went?
>
>
> -- 
> Charles Knell
> cknell@onebox.com - email
>
>
>
> -----Original Message-----
> From:     cknell@onebox.com
> Sent:     Fri, 03 Mar 2006 13:36:07 -0500
> To:       fop-users@xmlgraphics.apache.org
> Subject:  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 <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
>
>
>
>
> ---------------------------------------------------------------------
> 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
>



---------------------------------------------------------------------
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