I have XML like,
<items>
<item>
<products>
<product>laptop</product>
<product>charger</product>
<product>Cam</product>
</products>
</item>
<item>
<products>
<product>laptop</product>
<product>headphones</product>
<product>Photoframe</product>
</products>
</item>
<item>
<products>
<product>laptop</product>
<product>charger</product>
<product>Battery</product>
</products>
</item>
</items>
and I am using xslt on it
//can't change xpath as getting it from somewhere else
<xsl:param name="xparameter" select="items/item[products/product='laptop' and products/product='charger']"></xsl:param>
<xsl:template match="/">
<xsl:for-each select="$xparameter">
<xsl:for-each select="products/product[not(.=preceding::product)]">
<xsl:sort select="."></xsl:sort>
<xsl:value-of select="." ></xsl:value-of>,
</xsl:for-each>
</xsl:for-each>
</xsl:template>
I want the output to be
laptop
charger
cam
Battery
But I m not getting the result as I m expecting...distinct values is working fine ..something is getting wrong when I am adding that and claus