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: "Flanders, Charles E (US) charles.flanders@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 6 Nov 2019 15:39:37 -0000
Using Saxon HE 9.6.0.7 in Oxygen 18.1. Have access to EE and PE that are part
of Oxygen.


Charles
FlandersB B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B
 B B B B B B B B B B B B B B B B B B B B B B B 
Sr Principal Tech Manual Developer | Vasont Architect | Certified XML
Developer
T 717 524 0665 | M 717 668 4370 | charles.flanders@xxxxxxxxxxxxxx
BAE Systems | Combat Vehicles | York, PennsylvaniaB 
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 


-----Original Message-----
From: Martin Honnen martin.honnen@xxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, November 6, 2019 10:24 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Comparing node-sets or groups. Deep-equal with an
exception?

*** WARNING ***
EXTERNAL EMAIL -- This message originates from outside our organization.


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