xsl-list
[Top] [All Lists]

Re: [xsl] Merging data based on attributes

2006-08-23 10:36:58
On 8/23/06, David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> 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(_dot_)bobp(_at_)gmail(_dot_)com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>