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

Re: newbie question

Subject: Re: newbie question
From: Aad Kamsteeg <a.kamsteeg@xxxxxxxxxxxxxxx>
Date: Fri, 30 Jul 2004 11:27:00 +0200
aad kamsteeg
Try this:

<xsl:template match="link">
<xsl:choose>
<xsl:when test="starts-with(., 'http://') or starts-with(., 'ftp://')">
<a href="{.}">text</a>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:template>

:-) Aad

Dionylon Briones wrote:

hello everyone,
i'm new to XSL and need help with this problem:

choose a link for the title, base on the following conditions:
 1. if the value of the link node has 'http://' string
 2. if there's no 'http://' string get the value of the link node that
contains 'ftp://' string

output should be: <a href="selected link">title</a>

thanks

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<record>
<data>
<link>http://www.link1.com</link>
<link>3csbv</link>
<link>ftp://link2.com</link>
<link>http://www.link3.com</link>
<title>title</title>
</data>
<data>
<link>45csgh</link>
<link>invalid link</link>
<link>ftp://link1.com</link>
<title>title</title>
</data>
</record>



-- ********************************************* Diderot Track bv - Consultants in Information

Phone: +31 (0) 70 3966304
Fax:   +31 (0) 70 3966305
Email: a.kamsteeg@xxxxxxxxxxxxxxx
Web:   www.diderottrack.nl
*********************************************

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.