This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: rendering Xlink from a XML by using XSL
- To: xsl-list at mulberrytech dot com
- Subject: Re: rendering Xlink from a XML by using XSL
- From: Eric van der Vlist <vdv at dyomedea dot com>
- Date: Fri, 10 Nov 2000 12:32:57 +0100
- References: <NEBBKOOCILKBKIHBHBJIMEIICAAA.handren@chello.se>
- Reply-To: xsl-list at mulberrytech dot com
Handren Ahmed wrote:
>
> hi!
>
> That was exactly what I meant!
:)
> I did write following code but it doesn't work either.
> In my xml file I wrote:
>
> <Adress xlink:type="simple" xlink:href="http://www.dsv.su.se"
> xlink:show="new"
> xmlns:xlink="http://www.w3.org/TR/xlink/"
> >Klick here</Adress>
>
> In my xsl file I try to show that link by writing the follwing code:
> <xsl:template match="*[@xlink:href]">
> <xsl:value-of select="."/>
> </xsl:template>
>
> How can I use Xlink? How can I click on the xlink:-)?
In this case, you'll probably want to generate some (X)HTML to visualize
this link.
To generate a (X)HTML hypertext link, you just need to generate a
classical "a" element:
<xsl:template match="*[@xlink:href]">
<a href="{@xlink:href}">
<xsl:apply-templates/>
</a>
</xsl:template>
And, if you want to handle the xlink:show="new", you can add a more
restrictive template that will be higher priority when xlink:show has
this value:
<xsl:template match="*[@xlink:href and @xlink:show='new']">
<a href="{@xlink:href}" target="_blank">
<xsl:apply-templates/>
</a>
</xsl:template>
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