[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: xsl:variable and creating conditional select
> <xsl:if test= "substring-after(.,' ')=''"> > <xsl:variable name="nextparent" > select="parent::GROUP/@CategoryOrGroupParent"/> > </xsl:if> > <xsl:if test= "substring-after(.,' ')!=''"> > <xsl:variable name="nextparent" > select="concat(substring-after(.,' > '),' ',$ROOT)"/> > </xsl:if> > > I know this won't work as the variables go out of scope. > However, I can't figure out how to set the expression in the > select of the > xsl:variable to give me the required results. > Any help would be greatly appreciated. If you want the nextparent variable to contain a node that you can use in a step, it's not as simple. However, if you just want the value of the CategoryOfGroupParent attribute, then variable nextparent choose when string-length(substring-after(., ' ')) = 0 valua-of parent::GROUP/@CategoryOrGroupParent otherwise value-of concat(substring-after(.,' '), ' ', $ROOT) Ah, seems that you just want a string value based on the second condition result. Hope you can read the pseudo-code above, Cheers, Jarno - Aiboforcen: The Shepherd's Deathline (Flesh Field remix) XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|