| Changes to /trunk/odf-compare/make-fingerprint.xsl |
r0 vs. r2
Edit
|
r2
|
| /trunk/odf-compare/make-fingerprint.xsl | /trunk/odf-compare/make-fingerprint.xsl r2 | ||
| 1 | <?xml version="1.0"?> | ||
|---|---|---|---|
| 2 | <xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | ||
| 3 | <xsl:template match="/"> | ||
| 4 | <fingerprint> | ||
| 5 | <xsl:variable name="docelem" select="/*"/> | ||
| 6 | <xsl:for-each select="distinct-values(//namespace::*)"> | ||
| 7 | <xsl:sort/> | ||
| 8 | <xsl:variable name="uri" select="."/> | ||
| 9 | <xsl:message>Processing namespace <xsl:value-of select="$uri"/></xsl:message> | ||
| 10 | <namespace name="{.}"> | ||
| 11 | <xsl:variable name="all-elements-in-ns"> | ||
| 12 | <xsl:for-each select="$docelem//*[namespace-uri()=$uri]"> | ||
| 13 | <e> | ||
| 14 | <xsl:value-of select="local-name(.)"/> | ||
| 15 | </e> | ||
| 16 | </xsl:for-each> | ||
| 17 | </xsl:variable> | ||
| 18 | <xsl:for-each select="distinct-values($all-elements-in-ns//*)"> | ||
| 19 | <xsl:sort/> | ||
| 20 | <xsl:variable name="lname" select="."/> | ||
| 21 | <element name="{$lname}" | ||
| 22 | count="{count($docelem//*[local-name()=$lname and namespace-uri()=$uri])}"/> | ||
| 23 | </xsl:for-each> | ||
| 24 | </namespace> | ||
| 25 | </xsl:for-each> | ||
| 26 | </fingerprint> | ||
| 27 | </xsl:template> | ||
| 28 | </xsl:transform> | ||