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

RE: about & ...

Subject: RE: about & ...
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Fri, 20 Jun 2003 11:30:13 -0400
xml to pdf ampersand amp
[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 &amp; Drink', '&amp;','')

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(.,'&amp;', '')

Cheers,

Tom P

 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.