[Home] [By Thread] [By Date] [Recent Entries]
I didn't really understand your problem description, but this generates
the required output:
['aaa'],['bbb', 'ccc', 'dddd', 'eeee', 'gggg'],['fffff'] <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
</xsl:stylesheet> Note <xsl:text disable-output-escaping="no"> you never need to use d-o-e ="no" as that is the default 9and you hardly ever need d-o-e at all) //c[1][ancestor::b/@name=$node]" That generates every c in the document that is the first child of any element that has an ancestor b with the required name. did you intend to select the first c in the document that is a descendant of such a b? that would be (//b[@name=$node]//c)[1] but note (unless your xslt processor is being kind and rewriting it for you) // can be very expensive and you are better to use a key or for-each-group. <xsl:value-of select="./text()"/> you never need to start a path with ./ this is teh same as text() but using text() makes the code fragile in the face of coments or other markup in the source, better just to use <xsl:value-of select="."/> David
|

Cart



