Subject: Re: [xsl] Find a specific element or fall back to element 1 From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Tue, 16 Jan 2007 00:06:39 +0100 |
<xsl:variable name="gallery-xml-file" select="document($gallery-xml-path)"/> <xsl:variable name="test-position"> <xsl:for-each select="$gallery-xml-file//image"> <xsl:if test="@default='true'"> <xsl:value-of select="position()"/> </xsl:if> </xsl:for-each> </xsl:variable> <xsl:variable name="display-position"> <xsl:choose> <xsl:when test="$test-position = ''">1</xsl:when> <xsl:otherwise> <xsl:value-of select="$test-position"/> </xsl:otherwise> </xsl:choose> </xsl:variable>
This seems a bit long and wasteful to me. Is there a better way?
Cheers, -- Abel Braaksma http://www.nuntia.nl
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Find a specific element o, Abel Braaksma | Thread | RE: [xsl] Find a specific element o, John Horner |
RE: [xsl] Find a specific element o, Michael Kay | Date | Re: [xsl] Find a specific element o, Abel Braaksma |
Month |