Subject: Re: [xsl] Re: "if-condition-return something" idiom : is it possible in XSLT 1 ? From: "John Lumley john@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 16 Jun 2014 13:11:26 -0000 |
The <xsl:choose><xsl:when><xsl:otherwise> construct is probably most appropriate for cases where the scope of the conditionality is very localised (and would involve not just patterns on the context item, as in this case where you have variables). It also has the benefit of a strict and explicit test-precedence order.And just to be clear, I am asking about XSLT1. (I am doing DocBook transformations and am trying to parse dates as strings)
......
<xsl:template name="test.1"> <xsl:param name="string" select="''"/>
<xsl:if test="$check.1 = 0"> <xsl:value-of select="$value.1" /> </xsl:if>
<xsl:if test="$check.2 = 0"> <xsl:value-of select="$value.2" /> </xsl:if>
<xsl:if test="$check.3 = 0"> <xsl:value-of select="$value.3" /> </xsl:if>
<xsl:value-of select="$value.4" /> </xsl:template>
-- *John Lumley* MA PhD CEng FIEE john@xxxxxxxxxxxx <mailto:john@xxxxxxxxxxxx> on behalf of Saxonica Ltd
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Re: "if-condition-return , Graydon graydon@xxxx | Thread | Re: [xsl] Re: "if-condition-return , Dimitre Novatchev dn |
Re: [xsl] "if-condition-return some, Kerry, Richard richa | Date | Re: [xsl] Re: "if-condition-return , Kerry, Richard richa |
Month |