xsl-list
[Top] [All Lists]

RE: Combining XML with XLink to produce HTML

2003-07-17 15:46:09
Hi

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Christos Tsoukalas
Sent: Thursday, July 17, 2003 3:14 PM
To: 'XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com'
Subject: [xsl] 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="{(_at_)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



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