Altova Mailing List Archives


Re: [xsl] Character substitution

From: Sven Waibel <sven.waibel@-------->
To:
Date: 1/10/2005 10:22:00 AM
Yes that's not really the problem, the problem is that my text() returns nothing, so nothing can be replaced.

David Carlisle wrote:

>>how is the euro character represented in your document ?
> 
> 
> It never matters how the source document is encoded, all such matters
> are resolved by the XML parser before XSLT starts.
> 
> 
>>is it an entity (e.g. I think its numeric entity is &128;) if so u might 
>>have to;
> 
> 
> Numeric character references are not entity references (they refer to
> characters not entities) the number for Euro is 8364 not 128.
> 
> 
>>- try using numeric entity for replacement
> 
> 
> You can use any XML syntax for that character in your stylesheet, a
> numeric character reference, or if it is in the encoding  used by the
> stylesheet you may use character data directly.
> 
> 
>>- make sure your xml encoding is iso-8859-1 (or UTF-8)
> 
> 
> iso-8859-1  doesn't have a euro, utf8 does. So if you use iso-8859-1 
> then you can't enter the euro directly, you'd have to use a character
> reference. 
> 
> You can use the character reference & # 8 3 6 4 ; in any encoding (so
> long as the encoding includes the digits and the characters & # ;)you
> can take a look at an xsl template that has
> 
> 
>>been tested over time at 
>>  exslt.org
>>http://www.exslt.org/str/functions/replace/index.html
> 
> 
> Since the request was just to change one character by another, the
> general replace template isn't needed you can just use the translate()
> function.
> 
> David
> 
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by Star. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> ________________________________________________________________________

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.