I have the following XML:
<a> <b> <d>D1 content (can include child nodes)</d> </b> <b> <c>C1 content (can include child nodes)</c> </b> <b> <e>E1 content (can include child nodes)</e> </b> <b> <c>C2 content (can include child nodes)</c> </b> </a>
Using XSLT 1.0, I just need to produce this: "cde"; that is, a separate list of immediate child names / a / b / ordered by node name. Each b has exactly one child of any name.
I can create "ccde":
<xsl:for-each select="/a/b/*"> <xsl:sort select="name(.)"/> <xsl:value-of select="name(.)" /> </xsl:for-each>
I tried using the usual previous-sibling :: comparison, but since each b has only one child, the previous brother is always nothing.
xslt distinct
sellotape Nov 28 '09 at 18:23 2009-11-28 18:23
source share