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="//[EMAIL PROTECTED]'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,
--
*Martin Polley
*+972 (52) 3864280
Homepage <http://212.179.45.118:8080/cocoon/writestuff/index.html>


-----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.2.4 (MingW32)

mQGiBEECX6QRBADLc8aOn4ZYYceFXPahxpDjd9qHNxMd/OnpLI/7v5o0ORz914vC
35Aqs3yITM2Bg7976IEVYHMa8+asJuPSdw8VZKulbtZRJOrxAR47GVei9ogSzsDq
bMFduuCO8ObddV1C4huUdC1KedcXQm4kvP75HX1UdeYYJLFPYHw9K4JmCwCglEeP
II3D4AC7CMn4BR3uwbEcANEEAMbjpQAvfJ7/P+nJglw0joUJnmIOaAN7DpEgK4fs
IbDlVECJkqM+ucFyzu+TV7mzgU21AHOgdaJQX3Ys7dCQHEsxqyQzkiLwsdqb8Ti6
sPJue+W0anjsXd56WqwZdno4PJfS75JJ2MQKRJECe2xrn9SByhwro53mCImjus2/
9PCDBACerr+2CgscX5z0zCOD6ov+woSoft95suoyvIjazSYY0mkNCNVUEb5iTGSt
jCl/LNYLkPcqTVCXcSWofQUW5gkp2GZH99KiNiS7U1TUMDO5SpMn8IgqkfxdzT8V
Yc7QSpqGPe7A5td0Qk4G51c4ajRJDrG1B7rToZYd3YYGI9+I+rQuTWFydGluIFBv
bGxleSAoSG9tZSkgPG1hcnRpbi5wb2xsZXlAZ21haWwuY29tPoheBBMRAgAeBQJB
Al+kAhsDBgsJCAcDAgMVAgMDFgIBAh4BAheAAAoJEDPX1JyF4zeSt6IAn1Hccnof
RHA+pnHu5b11cp+b2dBaAJsHhYhog3h0qjLjTlHfov4gepDVYLkBDQRBAl+mEAQA
gcpbUCEhWosGpDbT5SW6YRXDHTlGpo+Jd+Z1ATxvSqMLj7t80XyTmADHhLWZesm2
BEZ+LuYxO3PZWqVPXizXyIxwVvbkq4PsFncA+kDQL8DJ57c6Am35sY5xzQSpPtg6
Esak2UF5A627dHfpXiqFoGBRf+edMnmjnOstxLnCmAcABAsD/jQ5tDTXHJkHMKPv
yAy1pSVoPecL6w604aTiwR6qzB39I2IN3aBtVVUbZdQyXEj6DU4WPaboEXG5CM0g
3jmOjtgKd4YV83f/1H5t2tdYtfw4lKPdgoIBxKuwXrUZ0Hsbjkj0eiC/d18rOFgU
3lcbuDb8p4clrTUkfYuL/JEMqFQniEkEGBECAAkFAkECX6YCGwwACgkQM9fUnIXj
N5IZuACggG5ZfRtfBBMHIiOVFmQJvYj0e6gAn3XGPRgmRURmUrY9Qoxr091jnMqZ
=R8rS
-----END PGP PUBLIC KEY BLOCK-----



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0516-0, 04/18/2005
Tested on: 4/19/2005 9:25:38 AM
avast! - copyright (c) 2000-2004 ALWIL Software.
http://www.avast.com





Reply via email to