Subject: Re: [xsl] problem with handling conditional for loops From: Rahil <qamar_rahil@xxxxxxxxxxx> Date: Wed, 27 Apr 2005 18:06:06 +0100 |
Sorry trouble already. $nodeToProcess now correctly contains values found in either the <xsl:when> or <xsl:otherwise> statement.
<xsl:choose>
<xsl:when test="document(Second.xml)/SubConcepts/SubConcept[1]/Value[$clsName=text()]">
<xsl:variable name="nodeToProcess"
select="document(Second.xml)/SubConcepts/SubConcept[1]/Value[$clsName=text()]"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="Values"
select="document(Second.xml)/SubConcepts/SubConcept/Value/@name[.=$clsName]"/>
<xsl:variable name="nodeToProcess" select="$Values[1]"> </xsl:otherwise> </xsl:when> <<<
You probably want:
<xsl:variable name="nodeToProcess"> <xsl:choose> ... </xsl:choose> </xsl:variable>
The choose should be inside the variable definition; else the variable goes out of scope when the choose finishes.
Suggestions Rahil
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] problem with handling con, Aron Bock | Thread | Re: [xsl] problem with handling con, Jon Gorman |
RE: [xsl] intersection of different, Michael Kay | Date | [xsl] Can XSLT remember the occurre, Thorsten Scherler |
Month |