Hi. 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 need to produce from this simply: "cde"; i.e. a distinct list of the names of the immediate children of /a/b/ ordered by the node name. Each b has exactly one child of arbitrary name.
I can produce "ccde":
<xsl:for-each select="/a/b/*">
<xsl:sort select="name(.)"/>
<xsl:value-of select="name(.)" />
</xsl:for-each>
I've tried using the usual preceding-sibling:: comparison, but as each b only has one child, the preceding sibling is always nothing.