If you want the unique value for each attribute with XSLT it is a problem
of grouping and sorting, and you can use xsl:key.
For instance you can declare a key :
<xsl:key name="valuesOfRend" match="@rend" use="."/>
(or <xsl:key name="valuesOfRend" match="//hand" use="@rend"/> if you want
only the @rend in <hand>)
And then output the different values :
<p>Different value of @rend:</p>
<xsl:for-each select="//*[count(@rend | key('valuesOfRend', @rend)) =
<xsl:value-of select="@rend" /><br />
But doing this for each attribute is quite boring. For consistency of
element, etc., perhaps this rules could (and should) be express via a DTD.
If it possible the best tool is a DTD and a validating parser.
> It's almost possible to write a fairly simple Perl script to do this
> just operating directly on the XML files, but it won't properly handle
> XML containing tags within comments, CDATA sections, and so on.
With XML::SAX you have both Perl and proper access to the XML content. By
"tags within comments", if you mean tags commented out with <!-- -->, I
believe it can't be handle by any parser, as the content of a comment is
parsed as raw text.