Re: rendering Xlink from a XML by using XSL

Subject: Re: rendering Xlink from a XML by using XSL
From: Eric van der Vlist <vdv@xxxxxxxxxxxx>
Date: Fri, 10 Nov 2000 12:32:57 +0100
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="";
> xlink:show="new"
> xmlns: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}">

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">

Hope this helps.

Eric van der Vlist       Dyomedea              

 XSL-List info and archive:

Current Thread