how to test a marker in an xsl:if (via a variable?)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to test a marker in an xsl:if (via a variable?)

Arian Hojat
Hey all,
I would like to make something show up in my xsl if the marker is set to a certain value...
So I set a marker in a template and then another template is called... In that 2nd template, i have a line like so:

<xsl:variable name="var_birthday"><fo:retrieve-marker retrieve-class-name="birthday"/></xsl:variable>
<xsl:if test="$var_birthday != ''">
....some output
</xsl:if>

but above doesnt work as I'd expect... Can I do this without passing xsl:param's into the template and just use the marker somehow in the if statement?

My best idea was to  place it like above in a variable, but doesnt work like I expected.

Thanks,
Ari
Reply | Threaded
Open this post in threaded view
|

Re: how to test a marker in an xsl:if (via a variable?)

David Carlisle
On 03/03/2010 22:50, Arian wrote:

> Hey all,
> I would like to make something show up in my xsl if the marker is set to
> a certain value...
> So I set a marker in a template and then another template is called...
> In that 2nd template, i have a line like so:
>
> <xsl:variable name="var_birthday"><fo:retrieve-marker
> retrieve-class-name="birthday"/></xsl:variable>
> <xsl:if test="$var_birthday != ''">
> ....some output
> </xsl:if>
>
> but above doesnt work as I'd expect... Can I do this without passing
> xsl:param's into the template and just use the marker somehow in the if
> statement?
>
> My best idea was to  place it like above in a variable, but doesnt work
> like I expected.
>
> Thanks,
> Ari

The xsl file generates an xsl-fo document as essentially a static xml
file (even if it is never actually serialised to disk) then that xsl-fo
XML document is interpreted by the XSL-FO renderer as a completely
separate process. markers are set and retrieved by the xsl-fo engine.
the xslt engine knows nothing at all about XSL-FO, it just generates
those elements as input to a following process.

David

Reply | Threaded
Open this post in threaded view
|

Re: how to test a marker in an xsl:if (via a variable?)

Arian Hojat
ah, that makes alot of sense. Thanks David.
I figured i was for-each-ing the students nodes anyway, and creating new page-sequence's for each student. so the node I wanted was static throughout all the pages for each student to put into the header region, so I could just get its value and test via regular xsl:if's easily versus doing stuff markers were not meant to do.

Thanks!,
Arian



On Wed, Mar 3, 2010 at 6:58 PM, David Carlisle <[hidden email]> wrote:

The xsl file generates an xsl-fo document as essentially a static xml file (even if it is never actually serialised to disk) then that xsl-fo XML document is interpreted by the XSL-FO renderer as a completely separate process. markers are set and retrieved by the xsl-fo engine.
the xslt engine knows nothing at all about XSL-FO, it just generates those elements as input to a following process.

David