This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Implementing simple XLinks using XSL
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Implementing simple XLinks using XSL
- From: Eric van der Vlist <vdv at dyomedea dot com>
- Date: Mon, 18 Dec 2000 23:03:45 +0100
- Organization: Dyomedea <http://dyomedea.com>
- References: <00BB1956AE40D411B5B60050DA27311F121BF3@mail1.bluezone.net>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Adam Van Den Hoven wrote:
>
> But it doesn't seem to work.
When the XSLT processors will support XML fragments identifiers, ie
XPointers, you will be able to write:
<xsl:copy-of select="document(@xlink:href)" />
In the meantime, the source of your problem is probably that the id()
XPath function is always selecting a node from the current document and
you need to change of document before using it.
The following sheet does what you expect (at least with XT):
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink/namespace/">
<xsl:template match="* | @* ">
<xsl:copy>
<xsl:apply-templates select="@* | *"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*[@xlink:show='embed'][@xlink:actuate='onLoad']">
<xsl:apply-templates
select="document(substring-before(@xlink:href,'#'))" mode="include">
<xsl:with-param name="id" select="substring-after(@xlink:href, '#')"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="/" mode="include">
<xsl:param name="id"/>
<xsl:copy-of select="id($id)" />
</xsl:template>
</xsl:stylesheet>
Hope this helps.
Eric
--
------------------------------------------------------------------------
Eric van der Vlist Dyomedea http://dyomedea.com
http://xmlfr.org http://4xt.org http://ducotede.com
------------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list