This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Using XLS to transform/join two XML docs.
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Using XLS to transform/join two XML docs.
- From: Goetz Bock <bock at blacknet dot de>
- Date: Wed, 20 Dec 2000 00:03:30 +0100
- References: <55449838504DD411A7A300508BDC963F421FED@SEAEXCH03>
- Reply-To: xsl-list at lists dot mulberrytech dot com
> This may be a complete bonehead question, but I don't have enough experience
> to know the difference :)
> <one>
> <a b="1">First Choice</a>
> <a b="2">Second Choice</a>
> <a b="3">Third Choice</a>
> </one>
>
> <two>
> <x id="1" b="1" this="that" them="those" />
> <x id="2" b="3" this="that" them="those" />
> </two>
>
> And wind up with:
>
> <three>
> <x id="1" b="First Choice" this="that" them="those" />
> <x id="2" b="Third Choice" this="that" them="those" />
> </three>
>
> Is this possible, or is it beyond the scope of XSL?
It's no problem (at last it's possible), but you must know the
first document's location:
<template match="two">
<tree>
<apply-templates select="x"/>
</tree>
</template>
<template match="x">
<element name="x">
<attribute name="id"><value-of select="@id"/></attribute>
<attribute name="b"><value-of select="document('where
ever')//one/a[b=@b]"/></attribute>
<attribute name="them"><value-of select="@them"/></attribute>
</element>
</template>
This might not be right, but it's close.
Cu,
Goetz.
PGP signature