Sorry, I didn't read the bottom.
You can only include one <xsl:when> as a child of <xsl:choose>. (There
is no concept of a case switch or elsif in XSLT.)
test="//eraname" returns true if there is an element <eraname> anywhere
in the document. To search only the children of the current node, take
out the '//' part.
To do what you want try this (anyone knows of a more elegant method,
please chime in):
<fo:block font-family="Helvetica" font-size="18pt"
text-align="end">
<xsl:choose>
<xsl:when test="eraname or conflictname">
<xsl:choose>
<xsl:when test="eraname">
<xsl:value-of select="eraname"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="conflictname"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>History of the World</xsl:text>
</xsl:otherwise>
</xsl:choose>
</fo:block>
> Edward Dowgiallo wrote:
>
> I seem to be not getting the intended use of xsl:choice.
>
> The following stylesheet segment causes fop to terminate with the
> message: ...; Line 78 Column 25; [ERROR]: null
>
> <fo:block font-family="Helvetica" font-size="18pt"
> text-align="end">
> <xsl:choice>
> <xsl:when test="//eraname">
> <xsl:value-of select="//eraname"/>
> </xsl:when>
> <xsl:when test="//conflictname">
> <xsl:value-of select="//conflictname"/>
> </xsl:when>
> <xsl:otherwise>
> <xsl:text>History of the World</xsl:text>
> </xsl:otherwise>
> <xsl:choice>
> </fo:block>
> 1st, a more verbose error message would be useful.
>
> 2nd, What I am trying to do is find out if the current element
> contains an element named "eraname", if it does I want to use the
> value of the element "eraname"
> If it doesn't I want to check if the current element contains a child
> element named "conflictname", if it does I want to use the value of
> the element "conflictname".
> If it doesn't I want to slap in some boiler plate text.
>
> The xml file being processed when this fails does contain the child
> element "eraname".
>
> I'd be more than happy to use a workaround here.
>
> Thank you,
> Ed
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]