This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: AW: character transformation, possible?


Marcus Klinge wrote at 16 May 2001 17:39:57 +0200:
 > You might want to try the string-function translate.
 > 
 > For example:
 > 
 > <xsl:value-of select="translate(EXAMPLE,'"\','&\\')"/>

That's wrong on several levels.  For starters, you can't have a bare
'&' in an attribute value.  Secondly, translate() only works character 
by character, so '"' will be translated to '&' and '\' will be
translated to '\'.

It's a good rule of thumb to check Dave Pawson's XSL FAQ before
posting any question.  (It even says so on the XSL-List's web page.)

See http://www.dpawson.co.uk/xsl/stringreplace.html.

Regards,


Tony Graham
------------------------------------------------------------------------
Tony Graham                           mailto:tony.graham@ireland.sun.com
Sun Microsystems Ireland Ltd                       Phone: +353 1 8199708
Hamilton House, East Point Business Park, Dublin 3            x(70)19708

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]