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

Re: removing spaces from attributes with saxon

Subject: Re: removing spaces from attributes with saxon
From: Oleg Tkachenko <olegt@xxxxxxxxxxxxx>
Date: Mon, 29 Apr 2002 14:58:44 +0200
xsl variable remove space
ChivaBaba@xxxxxxx wrote:

I'm using Saxon652 and got problems when I want to use the normalize-space() - function to remove white-spaces from an attribute.
normalize-space() function doesn't remove all white spaces, it's "normalize", not "remove" function, read spec what the normalizing means: http://www.w3c.org/TR/xpath.html#function-normalize-space
You should probably use translate() function to get rid of spaces.


 <xsl:variable name="f">
  <xsl:value-of select="normalize-space(@name)"/>
 </xsl:variable>

<xsl:value-of select="translate(@name, ' ', '')"/>



ps.: one more general question: is it not possible to declare variables by referring to values of other variables, as the following example shows:

<xsl:variable name="sep" select="system-property('file.separator')"/>
<xsl:variable name="dir" expr="{$sep}html{$sep}"/>
What the expr atribute? There is no such attribute and this should be syntax error at all. Use concat() function to concat string values:

<xsl:variable name="dir" select="concat($sep, 'html', $sep)"/>

--
Oleg Tkachenko
Multiconn International, Israel


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.