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

document() merge DISTINCT

Subject: document() merge DISTINCT
From: "Alex Schuetz" <asc@xxxxxx>
Date: Wed, 19 Dec 2001 10:30:56 +0100
 document() merge DISTINCT
Hallo;

I have some input files  with the /person/@id attribute being unique in each
file (and /project).

input.xml
--------------------------------------------------------------
<project name="some-name">
    <person id="1" name="name1"/>
    <person id="5" name="other-name"/>
    <preson id="20" name ="another-name"/>
</project>
------------------------------------------------

I want to merge these files so that I get a list of all <person> that are in
any <project> but the preson/@id should be unique, that is, no <person>
element should be listed twice.

In the book 'XSLT' from Dough Tidwell (chapter 7) there is an example that
works but is using a lot of disk reads and deep recursion.
It goes like this:

1: build a variable var1 as a white-space separated sorted list of all @id .
(using <xsl:for-each select="document(...)"..../> )
2: build a variable var2 of unique @id from  var1 (by recursion);
3: with var2 call a template that  calls <xsl:for-each select=
"document(....)"../> for each id in var2 and produces the output.

Is there a better way to do this?

-Alex
asc@xxxxxx




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.