Subject:xsl:choose code Author:Minollo I. Date:21 Jan 2005 10:26 PM
Nayu,
the "when" condition about "data/@value='premium'" looks fine, but the structure of your XSLT is a bit weird:
- the <xsl:choose> is executed only once, as you are not looping through all the contentBlock elements and it's part of a template that matches "document", which is the (single) document root; so I wonder how you may be hitting multiple branches of the xsl:choose
- after I modified the stylesheet to loop on the contentBlock elements, I noticed that the first <xsl:when> branch (data/@value = 'standard') "hides" the one about data/@value = 'premium'; even in the case in which you have a data sub-element which is "premium", you also have a sibling which is "standard"... As "standard" is checked first, that hides the "premium" branch
I would suggest re-designing that part of the stylesheet and making it rely more heavily on xsl:apply-templates instructions that may better model the structure of your XML document.