Re: Apostrophe in XUpdate select string

Yan Langlois <[email protected]>
Newsgroups gmane.text.xml.xindice.user
Message-ID <[email protected]>
I am not sure it could help but did you try this character "\" as an 
escape character ?
For example: 'Don't try this at home' would be replace by 'Don\'t try 
this at home'

Yan.


Martin Polley wrote:

> I have a JSP page that takes a request and constructs an XUpdate query 
> from it. The problem is that the selector string can include 
> apostrophes. When such a string is incorporated into the XUpdate 
> expression it causes an error (misquoted literal... expected single 
> quote!).
>
> The offending XUpdate query looks something like this:
>
> <xu:modifications version="1.0" 
> xmlns:xu="http://www.xmldb.org/xupdate"><xu:update 
> select="//*[@name='Don't try this at 
> home']/@description">Test</xu:update></xu:modifications>
>
> No surprise that it doesn't work...
>
> How can I get around this?
>
> I have tried replacing the apostrophe with &apos; (by using the 
> replaceAll() function), but the result is exactly the same. In the 
> XUpdate query (which the page writes to the log), it appears as 
> "Don&apos;t", but submitting this query results in the same error.
>
> Any ideas?
>
> TIA,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.