|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: about & ...
[Fei Zheng]
> I'd like to translate "Food & Drink" into "FoodDrink".
>
> I use this: translate('Food & Drink', '&', '' );
>
> Apparently, an error occurs with the code above because of
> the '&'. Can anyone tell how to handle the '&' here?
>
This is XML we are using here, and a bare "&" is not legal in character
content. So you just have to use & a m p ; (letters spaced out on
purpose here) -
translate('Food & Drink', '&','')
You probably got "Food & Drink" by typing it into the stylesheet -
because a well-formed xml file cannot contain an ampersand like that -
and that made the stylesheet not well-formed, hence you got an error.
In a more realistic setting, your code would look more like this -
translate(.,'&', '')
Cheers,
Tom P
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








