[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Comparing node-sets or groups. Deep-equal with an

Subject: Re: 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
Re:  Comparing node-sets or groups. Deep-equal with an
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.