|
Subject: Re: [xsl] Conditionally have an even page declaration From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Wed, 11 Jan 2012 15:48:28 -0500 |
Is it possible to conditionally define an even page, based on something in the xml?
I'm trying to do something with <xsl:if>, but I can't seem to get it to work, and I can't find good examples anywhere of using it not in a for-each.
This is what I have:
<xsl:if test="BolReport/ReportType = 'Term'"> <fo:simple-page-master master-name="even" page-width="8.5in" page-height="11in" margin-top="0.13in" margin-bottom="0.25in" margin-left="0.175in" margin-right="0.25in" background-image="url({BOLReport/TermPath})"> <fo:region-body/> </fo:simple-page-master> </xsl:if>
And then in the xml:
<BOLReport> ... <ReportType>Term</ReportType> ... </BOLReport>
<xsl:for-each select="BOLReport">
<fo:page-sequence master-reference="regular">
<xsl:if test="ReportType='Term'">
<!--override the regular master to force an even page-->
<xsl:attribute name="master-reference">even</xsl:attribute>
<xsl:attribute name="page-number">auto-even</xsl:attribute>
</xsl:if>
...
</fo:page-sequence>
</xsl:for-each>-- Contact us for world-wide XML consulting and instructor-led training Free 5-hour video lecture: XSLT/XPath 1.0 & 2.0 http://ude.my/uoui9h Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Google+ profile: https://plus.google.com/116832879756988317389/about Legal business disclaimers: http://www.CraneSoftwrights.com/legal
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Conditionally have an even pa, Colin DeClue | Thread | Re: [xsl] Conditionally have an eve, Colin DeClue |
| Re: [xsl] Removing unwanted namespa, Wendell Piez | Date | Re: [xsl] Removing unwanted namespa, ram |
| Month |