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

RE: Identical entries in different input documents sho

Subject: RE: Identical entries in different input documents should appear in the output document only once
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 7 Sep 2007 17:02:11 +0100
RE:  Identical entries in different input documents sho
In XSLT 2.0 this is a standard grouping problem that can be tackled using
xsl:for-each-group or distinct-values(). (Elimination of duplicates is
essentially the same problem as grouping: you group the values and then
select one member from each group.)

Most of the grouping techniques used in XSLT 1.0 fail when the population
spans multiple documents. The one exception is Ken Holman's "variable
grouping" approach, if I remember correctly. However, I don't know if this
is performant enough to cope with your volumes.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Meyer, Roland 1. (NSN - DE/Germany - MiniMD) 
> [mailto:roland.1.meyer@xxxxxxx] 
> Sent: 07 September 2007 16:54
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Identical entries in different input documents 
> should appear in the output document only once
> 
> Hi, 
> 
> I have the following problem. I have a couple of XML 
> documents to merge to one output document. 
> Each document has the same structure like this:
> 
> <root>
>   <block>
>     <oneTag>some value<oneTag>
>     <anotherTag>another value<anotherTag>
>      ...
>     <idTag>setId-itemId<idTag>
>   </block>
>   <block>
>      ...
>   </block>
>    ...
> </root>
> 
> I have to interpret the value in the idTag (the setId-itemId) 
> as an identifier for the complete structure between the block tags.
> Within one document this identifying value comes only once, 
> but the same identifying value can be found in different documents.
> 
> What I now need:
> My output file should list each block only ones, means 
> although the same identifying value is present in different 
> input documents, it should appear only once in the output document.
> 
> I can think about some heavy procedures by checking every 
> found identifier value in the already processed files 
> (because then they are already written to the output), but 
> this will be very time consuming (I have around 15 files with 
> each up to 10000 blocks). 
> 
> Is there any other and simpler way to - let's say - memorize 
> the already written blocks resp. identifiers?
> 
> Best Regards,
> Roland 

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.