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

Re: Merging data based on attributes

Subject: Re: Merging data based on attributes
From: "Bob Portnell" <simply.bobp@xxxxxxxxx>
Date: Wed, 23 Aug 2006 10:36:28 -0700
Re:  Merging data based on attributes
On 8/23/06, David Carlisle <davidc@xxxxxxxxx> wrote:
This seems to do what you need:

It certainly does! Many thanks. Now bear with me while I try to understand it...


The keys create tables linking the @ids to <element> and <phase>...
<xsl:key name="element" match="element" use="../@id"/>
<xsl:key name="phase" match="phase" use="../@id"/>

Then we look at any <text> child of <svg> than has the strings 'element' or 'phase'...
<xsl:template match="svg:text[.=('element','phase')]">

We recreate the <text> child here...
<text>

... including all its attributes ...
<xsl:copy-of select="@*"/>

And here's where I get lost, and it's the critical part.
<xsl:value-of select="key(.,../@id,doc('textsrc.xml'))"/>

Use the key corresponding to the node we're in ... and the @id of this node's parent ... and I can see the example in the XSLT 2.0 CR that this is emulating, but I'm just not understanding the roll of that third element in the key function. Obviously, that's where it's getting the other data and dropping it in.

How far wrong am I in parsing this?

And thanks again, David. The assist is much appreciated.

BobP
simply.bobp@xxxxxxxxx

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-2011 All Rights Reserved.