cThe further one dives into XSLT, it may become necessary to extract a list of unique values from an XML document. This is commonly done in SQL through the SELECT DISTINCT statement, unfortunately, there is no direct equivalent in XSLT 1.0.
In order to perform this sort of functionality, one must leverage some of the more advanced aspects of XSLT including the preceding-sibling:: or another such "axis" as it's known in XSL.
To better understand, lets look at an example. Given the following XSD snippet:
The following XSLT will extract a list of unique substitutionGroup attribute values from above and list them in the output:
The resulting output would appear something like the following:
The information surrounding this question was sourced in part from information provided on Stack Overflow here.