|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: problem with handling conditional for loops
But since you need to apply different xpaths we can do something similar...might be some scoping problems here (might have to move it so the <xsl:variable wraps around) but something like this should work (although I'm suspicious of the text(), it would seem to me you need . or something similar). <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. Regards, --A _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








