[Home] [By Thread] [By Date] [Recent Entries]
That's what I was about to post (using f:signature as what I called hash):
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:f="f" version="2.0" exclude-result-prefixes="f xs" > <xsl:output method="xml" indent="yes" /> <xsl:function name="f:signature"> <xsl:param name="map" as="element(map)" /> <xsl:variable name="sorted-map" as="element(singletonMap)*"> <xsl:perform-sort select="$map/*"> <xsl:sort select="@from"/> <xsl:sort select="@to"/> </xsl:perform-sort> </xsl:variable> <xsl:sequence select="string-join($sorted-map/concat(@from, '~', @to), '|')"/> </xsl:function> <xsl:template match="maps">
<xsl:for-each-group select="map" group-by="f:signature(.)">
<xsl:sequence select="." />
</xsl:for-each-group>
</xsl:template></xsl:stylesheet> Input (5 maps): <?xml version="1.0" encoding="utf-8"?>
<maps>
<map id="Planes-Enroute-to-Airports">
<singletonMap from="F16" to="DFW"/>
<singletonMap from="B707" to="ORD"/>
<singletonMap from="F35" to="MIA"/>
<singletonMap from="S340" to="LAX"/>
<singletonMap from="A320" to="SFO"/>
<singletonMap from="MD90" to="DEN"/>
</map>
<map id="Planes-Enroute-to-Airports">
<singletonMap from="F16" to="DFW"/>
<singletonMap from="B707" to="BER"/>
<singletonMap from="F35" to="MIA"/>
<singletonMap from="S340" to="LAX"/>
<singletonMap from="A320" to="SFO"/>
<singletonMap from="MD90" to="DEN"/>
</map>
<map id="Planes-Enroute-to-Airports">
<singletonMap from="F16" to="DFW"/>
<singletonMap from="B707" to="ORD"/>
<singletonMap from="F35" to="MIA"/>
<singletonMap from="S340" to="LAX"/>
<singletonMap from="A320" to="SFO"/>
<singletonMap from="MD90" to="DEN"/>
</map>
<map id="Planes-Enroute-to-Airports">
<singletonMap from="F16" to="DFW"/>
<singletonMap from="F35" to="MIA"/>
<singletonMap from="S340" to="LAX"/>
<singletonMap from="A320" to="SFO"/>
<singletonMap from="MD90" to="DEN"/>
</map>
<map id="Planes-Enroute-to-Airports">
<singletonMap from="F16" to="DFW"/>
<singletonMap from="B767" to="ORD"/>
<singletonMap from="F35" to="MIA"/>
<singletonMap from="S340" to="LAX"/>
<singletonMap from="A320" to="SFO"/>
<singletonMap from="MD90" to="DEN"/>
</map>
</maps>Output (4 maps): <?xml version="1.0" encoding="UTF-8"?>
<maps>
<map id="Planes-Enroute-to-Airports">
<singletonMap from="F16" to="DFW"/>
<singletonMap from="B707" to="ORD"/>
<singletonMap from="F35" to="MIA"/>
<singletonMap from="S340" to="LAX"/>
<singletonMap from="A320" to="SFO"/>
<singletonMap from="MD90" to="DEN"/>
</map>
<map id="Planes-Enroute-to-Airports">
<singletonMap from="F16" to="DFW"/>
<singletonMap from="B707" to="BER"/>
<singletonMap from="F35" to="MIA"/>
<singletonMap from="S340" to="LAX"/>
<singletonMap from="A320" to="SFO"/>
<singletonMap from="MD90" to="DEN"/>
</map>
<map id="Planes-Enroute-to-Airports">
<singletonMap from="F16" to="DFW"/>
<singletonMap from="F35" to="MIA"/>
<singletonMap from="S340" to="LAX"/>
<singletonMap from="A320" to="SFO"/>
<singletonMap from="MD90" to="DEN"/>
</map>
<map id="Planes-Enroute-to-Airports">
<singletonMap from="F16" to="DFW"/>
<singletonMap from="B767" to="ORD"/>
<singletonMap from="F35" to="MIA"/>
<singletonMap from="S340" to="LAX"/>
<singletonMap from="A320" to="SFO"/>
<singletonMap from="MD90" to="DEN"/>
</map>
</maps>On 2012-08-20 01:16, Michael Kay wrote:
Registergericht / Commercial Register: Amtsgericht Leipzig Registernummer / Registration Number: HRB 24930 Geschdftsf|hrer: Gerrit Imsieke, Svea Jelonek, Thomas Schmidt, Dr. Reinhard Vvckler
|

Cart



