Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XPath for attributes with single and double quotes

From: richard@------.--.--.-- (------- -----)
To: NULL
Date: 8/4/2004 4:02:00 PM
In article <bd1c71f544187d108455c81937f02bb5@n...>,
girish  <girish.1ah25x@m...> wrote:

>In my XML document, some node attributes data contains both single quote
>and double quote characters
[...]
>I am not able to locate such elements using an XPath expression.

Yes, annoying isn't it.  You can't write an XPath string literal
that contains both kinds of quote.

You can construct the string by breaking it into pieces that use only
one kind of quote, and concatenating them using concat:

  //*[@msg=concat('Hello "World", What', "'s up")] 

If you're using this expression in a XML attribute (e.g. in an XSLT
stylesheet) you'll still need to escape whichever kind of quote is
used for the attribute value.

-- Richard


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent