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

fo:marker AND xsl-region-before

Expand Messages
  • notable17
    Is it possible to use fo:retrieve-marker in the xsl-region-before area to display the HeaderData at the top of every page and allow the HeaderData to
    Message 1 of 4 , Jun 20, 2005
      Is it possible to use fo:retrieve-marker in the xsl-region-before
      area to display the "HeaderData" at the top of every page and allow
      the "HeaderData" to change as the xml is traversed?
      When I do the following, The entire header always only shows the
      first "HeaderData" value and it never changes.

      Example XML
      <Reports>
      <Report>
      <HeaderData>This is the first header</HeaderData>
      <var1>ABC</var1>
      <var2>XYZ>/var2>
      </Report>
      <Report>
      <HeaderData>This is the second header</HeaderData>
      <var1>DEF</var1>
      <var2>UVW>/var2>
      </Report>
      </Reports>


      Example XSL
      <fo:static-content flow-name="xsl-region-before">
      <fo:block>
      <fo:retrieve-marker retrieve-class-name="marker-headerdata"/>
      </fo:block>
      </fo:static-content>

      <fo:flow flow-name="xsl-region-body">
      <fo:marker marker-class-name="marker-headerdata">
      <fo:block>
      <xsl:for-each select="HeaderData">
      <xsl:apply-templates/>
      </xsl:for-each>
      </fo:block>
      </fo:marker>
      </fo:flow>
    • arianhojat2000
      never tried it myself but this seems standard... http://www.renderx.com/tutorial.html#Markers ###In static content###
      Message 2 of 4 , Jun 20, 2005
        never tried it myself but this seems standard...
        http://www.renderx.com/tutorial.html#Markers

        ###In static content###
        <fo:static-content flow-name="header">
        <fo:block>
        Chapter #<fo:retrieve-marker retrieve-class-name="chapter"
        retrieve-position="first-starting-within-page" retrieve-
        boundary="page"/>
        </fo:block>
        </fo:static-content>

        ###somewhere in a flow###
        <fo:block>
        asdf...
        <fo:marker marker-class-name="chapter" >
        asdf...
        </fo:block>


        Optional attributes: retrieve-position and retrieve-boundary...
        I *guess* retrieve-position is for when there could be multiple
        markers on a page, which to use.

        and I also *guess* retrieve-boundary looks past the current page, for
        a marker, like a chapter marker could have been defined earlier in
        the page sequence instead of the page, so use that chapter marker
        since no new chapter is up yet (i dare make another guess it looks
        backwards from current page to find this marker if retrieve-
        boundary="page-sequence" is used).


        --- In XSL-FO@yahoogroups.com, "notable17" <darryl_grimes@h...> wrote:
        > Is it possible to use fo:retrieve-marker in the xsl-region-before
        > area to display the "HeaderData" at the top of every page and allow
        > the "HeaderData" to change as the xml is traversed?
        > When I do the following, The entire header always only shows the
        > first "HeaderData" value and it never changes.
        >
        > Example XML
        > <Reports>
        > <Report>
        > <HeaderData>This is the first header</HeaderData>
        > <var1>ABC</var1>
        > <var2>XYZ>/var2>
        > </Report>
        > <Report>
        > <HeaderData>This is the second header</HeaderData>
        > <var1>DEF</var1>
        > <var2>UVW>/var2>
        > </Report>
        > </Reports>
        >
        >
        > Example XSL
        > <fo:static-content flow-name="xsl-region-before">
        > <fo:block>
        > <fo:retrieve-marker retrieve-class-name="marker-headerdata"/>
        > </fo:block>
        > </fo:static-content>
        >
        > <fo:flow flow-name="xsl-region-body">
        > <fo:marker marker-class-name="marker-headerdata">
        > <fo:block>
        > <xsl:for-each select="HeaderData">
        > <xsl:apply-templates/>
        > </xsl:for-each>
        > </fo:block>
        > </fo:marker>
        > </fo:flow>
      • Chris Bowditch
        ... This is perfectly feasible. ... From the snippets provided I noticed that you have placed the fo:marker outside the xsl:for-each. I would have thought you
        Message 3 of 4 , Jun 20, 2005
          notable17 wrote:
          > Is it possible to use fo:retrieve-marker in the xsl-region-before
          > area to display the "HeaderData" at the top of every page and allow
          > the "HeaderData" to change as the xml is traversed?

          This is perfectly feasible.

          > When I do the following, The entire header always only shows the
          > first "HeaderData" value and it never changes.

          From the snippets provided I noticed that you have placed the fo:marker
          outside the xsl:for-each. I would have thought you needed to place fo:marker
          inside the for-each, so that each header is inside its own marker instance.
          You might also want to explicitly set retrieve-boundary and retrieve-position
          on the retrieve-marker just for the sake of clarity.

          <snip/>

          Chris
        • Eliot Kimber
          ... Something that always gets me about markers is that their retreival is controlled by the rendered position of their containers. Thus, in this snipet your
          Message 4 of 4 , Jun 20, 2005
            notable17 wrote:
            > <fo:flow flow-name="xsl-region-body">
            > <fo:marker marker-class-name="marker-headerdata">
            > <fo:block>

            Something that always gets me about markers is that their retreival is
            controlled by the rendered position of their containers. Thus, in this
            snipet your marker is a child of the entire flow, which means that any
            retrieve value you specify will only get one value, that bound to the flow.

            That is, the "retrieve-position" property refers to where the marker's
            *parent* occurs, not the marker itself.

            You almost certainly want to make your markers children of the block or
            wrapper that contains each division.

            Remember too that you can have as many marker instances as you need.
            It's not uncommon to emit a marker for every paragraph or table cell for
            some situations.

            Cheers,

            Eliot
            --
            W. Eliot Kimber
            Professional Services
            Innodata Isogen
            9390 Research Blvd, #410
            Austin, TX 78759
            (512) 372-8155

            ekimber@...
            www.innodata-isogen.com
          Your message has been successfully submitted and would be delivered to recipients shortly.