<page>
<tab dim="70"></tab>
<tab dim="40"></tab>
<tab dim="30"></tab>
<tab dim="30"></tab>
<tab dim="30"></tab>
<tab dim="70"></tab>
</page>
how to get the value of tab’s dim attributes and take out the distinct value using xslt.means it will print 30,40,70
To select the distinct attribute values, you can use this XPath:
A possible XSLT template would be
To transform the source document with the stylesheet in PHP, you can use:
This will give 30,40,70 in the output.
You can achieve the same without an XSLT by simply doing:
Also see