Re: [xsl] Comparing node-sets or groups. Deep-equal with an exception?

Subject: Re: [xsl] Comparing node-sets or groups. Deep-equal with an exception?
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 6 Nov 2019 15:23:28 -0000
Am 06.11.2019 um 15:50 schrieb Flanders, Charles E (US)
charles.flanders@xxxxxxxxxxxxxx:
I need help with an issue that I haven't come across before and I'm not even
sure that I have the subject correct. I am working with XSLT 2.0. Please no
3.0 solutions.


Which XSLT 2 processor do you use, any access to a proprietary "serialize" function? Otherwise I guess you will need to write a function computing some fingerprint, I think Dimitre has posted solutions on that in the past here.


I have a long list of <mac-group-2lvl> structures as below. Most are
unique. However in some cases, they are identical except for the "ref"
attribute value on the <teref>  element.

Write a function that pushes each element through a mode that strips
that attribute, then let it serialize the result or compute a
fingerprint, then use that fingerprint or serialization in
group-adjacent or group-by of for-each-group, pushing the context node
(i.e. first item in a group) through the identity transformation with
the collected

B B B B B B B B B B B B B B B B B B B B B  <xsl:with-param name="refs"
tunnel="yes"
select="current-group()//terefs/teref"/>

as a tunnel parameter:


B <xsl:template match="mac"> B B B B B <xsl:copy> B B B B B B B B B <xsl:apply-templates select="@*"/> B B B B B B B B B <xsl:for-each-group select="*" group-adjacent="mf:finger-print(.)"> B B B B B B B B B B B B B <xsl:copy> B B B B B B B B B B B B B B B B B <xsl:apply-templates> B B B B B B B B B B B B B B B B B B B B B <xsl:with-param name="refs" tunnel="yes" select="current-group()//terefs/teref"/> B B B B B B B B B B B B B B B B B </xsl:apply-templates> B B B B B B B B B B B B B </xsl:copy> B B B B B B B B B </xsl:for-each-group> B B B B B </xsl:copy> B </xsl:template>


and insert it in


B  <xsl:template match="teref">
B B B B B  <xsl:param name="refs" tunnel="yes"/>
B B B B B  <xsl:sequence select="$refs"/>
B  </xsl:template>

Current Thread