Subject: RE: Combining XML with XLink to produce HTML
From: Américo Albuquerque <melinor@xxxxxxx>
Date: Thu, 17 Jul 2003 23:46:09 +0100
|
Hi
> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
> Christos Tsoukalas
> Sent: Thursday, July 17, 2003 3:14 PM
> To: 'XSL-List@xxxxxxxxxxxxxxxxxxxxxx'
> Subject: Combining XML with XLink to produce HTML
>
>
> Hi,
>
> My objective by combining "document1.xml" (the original XML document)
> and "document2.xml" (the XLink document) is to produce HTML code like:
>
> -----------------------------------------------
> <p align="justify">
> <a name="ct1-1">1</a>
> Please, see <a href="http://vendor1_anchor1">link</a>
> </p>
> -----------------------------------------------
>
You can do that with a simply template, using the document() function
<xsl:template match="ref">
<p align="justify">
<a name="{@id}">1</a>
<!--
open the 'document2.xml'
go through each plink that has a connect/@xlink:from equal to the
current's node id attribute (in this case will get only one
-->
<xsl:for-each
select="document('document2.xml')/links/plink[connect/@xlink:from=current()/
@id]">
Please, see <a href="{resource/@ID}">link</a>
</xsl:for-each>
</p>
</xsl:template>
(...)
Hope this helps you.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|