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

Re: XPath to find duplicate elements

Subject: Re: XPath to find duplicate elements
From: "Leo Studer leo.studer@xxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 5 Apr 2018 20:13:35 -0000
Re:  XPath to find duplicate elements
Dimitre, I am not sure whether I understand your two centsb&
For each node you read, you have to compare all following nodes. How would you
like to do that in the initial reading?

Yours
Leo


> On 5 Apr 2018, at 20:15, Dimitre Novatchev dnovatchev@xxxxxxxxx
<mailto:dnovatchev@xxxxxxxxx> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx
<mailto:xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>> wrote:
>
> Just a thought on this.
>
> If we can implement deep-equal($n1, $n2)  as calculating some
> ValueIdentity (VI) for each of the nodes and returning
>
>     VI1 eq VI2 ...
>
> Then the VIs for each node can be calculated on the initial reading of
> the XML document (even in streaming mode) with almost no additional
> effort. If these VIs are made properties of the nodes, then we could
> just compare the VIs of the nodes and avoid any repeated zip-like
> comparison of the subtrees that are topped by these nodes. And this
> also seems more declarative/functional.
>
> Just my 2c.
>
> Cheers,
> Dimitre
>
>>>
>>> let $xml := <a>
>>>                 <b>
>>>                     <c>1</c>
>>>                     <d>1</d>
>>>                     <d>2</d>
>>>                 </b>
>>>                 <b>
>>>                     <c>2</c>
>>>                     <d>1</d>
>>>                     <d>3</d>
>>>                 </b>
>>>                 <b>
>>>                     <c>3</c>
>>>                     <d>2</d>
>>>                     <d>3</d>
>>>                 </b>
>>>                 <b>
>>>                     <c>3</c>
>>>                     <d>2</d>
>>>                     <d>3</d>
>>>                 </b>
>>>             </a>
>>>             return

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.