[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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
Re: rendering Xlink from a XML by using XSL
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.