[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] group-by an optional attribute
Hi, Consider: <xsl:for-each-group select="current-group()" group-by="Stamp/@line" This fails because @line is an optional attribute and does not always appear in the XML. The only cure I can think of is to run a pre-processing stylesheet that, should the @line attribute be absent from a <Stamp> element, adds an @line="0" to each <Stamp> element. This is not a problem, but I wondered if there were another more elegant means making the group-by work? I tried to formulate an alternative, thinking this would group-by the true value of @line were it present, or by zero in its absence, but it fails: <xsl:for-each-group select="current-group()" group-by="if(Stamp/@line) then Stamp/@line else 0"> Thanks for any help, Mark
|
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
|