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

Re: transform a string

Subject: Re: transform a string
From: Geert Josten <Geert.Josten@xxxxxxxxxxx>
Date: Sat, 27 Nov 2004 09:50:34 +0100
transform string of xml
As been said in an other message just a few posts ago, translate is a character by character replacement. The third argument is empty, so all characters that occur in $baseDir are removed effectively.

Look at the following site for string replace solutions:
http://www.dpawson.co.uk/xsl/sect2/replace.html

Grtz,
Geert

Jan Limpens wrote:

hello,

within a xsl template I need to transform a physical path like
file:///D:/usr/jan/My Documents/Visual Studio
Projects/Web/Data/XmlContent/Development/TaskSheet.xml
to /Development/Tasksheet.aspx


I tried
<xsl:param name="baseDir" select="'file:///D:/usr/jan/My
Documents/Visual Studio Projects/Web/Data/XmlContent/'"/>

	<xsl:template match="site:document">
		<site:document>
			<site:xml-file>
				<xsl:value-of select="site:xml-file"/>
			</site:xml-file>
			<site:link>
				<xsl:value-of select="translate(string(site:xml-file), $baseDir, '')"/>
			</site:link>
		</site:document>
	</xsl:template>

but keep getting strange, scrambled results...

thanks for the help


-- Geert.Josten@xxxxxxxxxxx IT-consultant at Daidalos BV, Zoetermeer (NL)

http://www.daidalos.nl/
tel:+31-(0)79-3316961
fax:+31-(0)79-3316464

GPG: 1024D/12DEBB50

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.