Loading ...
Sorry, an error occurred while loading the content.

6867Re: How to use page-number-citation twice?

Expand Messages
  • michel_versteeg
    Oct 17, 2005
    • 0 Attachment
      Hi Ken,

      Excellent! Thanks to your advise I was able to correct my issue.

      "That surprises me because the code above shows the current node for
      the reference to be Package and for the referent "PackageBody".
      , but don't for template list-b."

      You're right, this is a mistake in my example.

      "Just review the node passed to generate-id() at the time of
      creating the reference and at the time of creating the referent."

      Just in case you wanted to know, using a fixed path
      (/elementname/elementname and so on) didn't work. A relative path
      did the trick though. In my case: <fo:page-number-citation ref-
      id="{generate-id(../..)}" />

      Thanks again for your help!
      Michel

      --- In XSL-FO@yahoogroups.com, "G. Ken Holman" <gkholman@c...> wrote:
      >
      > At 2005-10-17 09:16 +0000, michel_versteeg wrote:
      > >This is my first post, so I am very new at this. I am trying to
      use
      > >page-number-citation twice in my code, but the second time it just
      > >shows '0'. The output is in pdf format and I am using Antenna XSL
      > >formatter V3.
      >
      > A '0' in this tool indicates you are making a reference to an id=
      > that cannot be found in the area tree.
      >
      > >This is what I have sofar:
      > ><fo:page-sequence master-reference="frame-pages" force-page-
      > >count="even">
      > ><fo:flow flow-name="xsl-region-body">
      > ><xsl:apply-templates />
      > ><xsl:for-each select="/Package/PackageBody">
      > ><xsl:call-template name="individual-data"/>
      >
      > Okay ... current node is PackageBody at the time of the call.
      >
      > ><xsl:template name="list-a">
      > ><fo:table width="100%">
      > ><fo:table-body>
      > ><xsl:for-each select="Package">
      > ><fo:table-row>
      > ><fo:table-cell>
      > ><fo:block font-size="6pt">
      > ><fo:page-number-citation ref-id="{generate-id(.)}" />
      >
      > Okay, the current node for the g-id() function is Package.
      >
      > ><xsl:template match="list-b">
      > ><fo:table width="100%">
      > ><fo:table-body>
      > ><xsl:for-each select="key('funds-by-category', CategoryName)">
      > ><fo:table-row>
      > ><fo:table-cell>
      > ><fo:block font-size="6pt">
      > ><fo:page-number-citation ref-id="{generate-id(.)}" />
      >
      > Okay, above I see that the current node is going to be an entry
      from
      > the key table ... so you are citing the generated-id of a member
      of
      > 'funds-by-category'.
      >
      > ><xsl:template name="individual-data">
      > ><fo:page-sequence master-reference="frame-pages" force-page-
      > >count="even">
      > ><fo:flow flow-name="xsl-region-body">
      > ><fo:block id="{generate-id()}"></fo:block>
      >
      > The current node here is /Package/PackageBody
      >
      > >The page numbers in template list-a show correctly
      >
      > That surprises me because the code above shows the current node
      for
      > the reference to be Package and for the referent "PackageBody".
      >
      > >, but don't for template list-b.
      >
      > Then the key table does not contain the same kind of element as
      the
      > current node at the generation of the id= in the <block>-generated
      > areas in the area tree.
      >
      > >Both page-number-citation's refer to the same
      > >fo:block, which is probably the cause of the problem.
      >
      > No, there can be any number of citations to a given id= in the
      area tree.
      >
      > >I tried:
      > >
      > ><fo:page-number-citation ref-id="{generate-id(aaaa)}" /> in
      template
      > >list-a
      > ><fo:page-number-citation ref-id="{generate-id(bbbb)}" /> in
      template
      > >list-b
      > ><fo:block id="{generate-id(aaaa)}"></fo:block><fo:block
      > >id="{generate-id(bbbb)}"></fo:block> in template individual-data
      > >
      > >This results in just 0's for the page-number-citation's.
      >
      > Right ... because your XPath address for g-id() addresses
      something
      > that isn't there. You are asking for the element child
      named "aaaa"
      > and the element child named "bbbb" which I suspect you do not have
      in
      > your input.
      >
      > >Can anyone give me tips how to solve this?
      >
      > Perhaps you meant to try ref-id="aaaa" and ref-id="bbbb" for your
      test.
      >
      > Just review the node passed to generate-id() at the time of
      creating
      > the reference and at the time of creating the referent.
      >
      > I hope this helps.
      >
      > . . . . . . . . . . . . Ken
      >
      > --
      > World-wide on-site corporate, govt. & user group XML/XSL training.
      > G. Ken Holman mailto:gkholman@C...
      > Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
      > Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
      > Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/f/bc
      > Legal business disclaimers: http://www.CraneSoftwrights.com/legal
      >
    • Show all 9 messages in this topic