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

RE: both single and double quotes in an XPATH translat

Subject: RE: both single and double quotes in an XPATH translate()
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 28 Jun 2005 20:14:28 +0100
quot single qoute
The simple way to handle strings containing " and ' is to use an RTF
variable:

<xsl:variable
name="from">'!@#$%^*(),:;.?/\[]{}|=+-_*"&amp;&gt;&lt;</xsl:variable>

... translate(name, $from, '_______________________')...

Michael Kay
http://www.saxonica.com/


> -----Original Message-----
> From: Arian Hojat [mailto:arianhojat2000@xxxxxxxxx] 
> Sent: 28 June 2005 20:07
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  both single and double quotes in an XPATH translate()
> 
> Hello all,
> 
> I am trying to do a big translate on a string with
> special characters like so...
> 
> <xsl:value-of select="string( translate(./name, &apos;
> '!@#$%^*(),:;.?/\[]{}|=+-_*&quot;&amp;&gt;&lt;&apos; ,
> '________________________________') )" />
> 
> But I want to translate both single and double qoutes
> in there,
> Since the string is delimiting by &apos, I thought I
> could use single qoute' in there, but I get an
> error...
> 
> (Xalan, hav not tested in Saxon yet cause Xalan is the
> trouble maker usually for my code)
> javax.xml.transform.TransformerConfigurationException:
> javax.xml.transform.TransformerException:
> javax.xml.transform.TransformerException: Prefix must
> resolve to a namespace:
> 
> 
> I found this useful archived page for what I wanted to
> do.
> http://www.biglist.com/lists/xsl-list/archives/200107/msg00181.html
> but David leaves me hanging with the cliffhanger:
> "It gets more interesting when you need both " and '
> in the [Xpath] string." :)
> 
> Thanks,
> Arian
> 
> 
> 		
> __________________________________ 
> Yahoo! Mail 
> Stay connected, organized, and protected. Take the tour: 
> http://tour.mail.yahoo.com/mailtour.html 

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.