W3C home > Mailing lists > Public > www-xpath-comments@w3.org > January to March 2004

XPath 1.0: Literal with both ' and "?

From: Perry A. Caro <caro@adobe.com>
Date: Fri, 16 Jan 2004 14:29:32 -0800
To: www-xpath-comments@w3.org
Cc: caro <caro@adobe.com>
Message-id: <400865CC.50B9531A@adobe.com>

Production [29] of the XPath 1.0 spec says:

[29]    Literal    ::=    '"' [^"]* '"'  
                          | "'" [^']* "'" 

Given that, how do I form a literal that has both ' and " in it? For
example, I want to search for an attribute whose value is an excerpt from
some dialog:

	Tom said, "Why can't I read?"

In XML, this might be represented as:

	<excerpt text='Tom said, "Why can&apos;t I read?"'/>

How would I form a predicate in XPath 1.0 that would match the value of the
text attribute?

I think this might be a bug in the specification, but I didn't see any
mention of it in the Errata.

Perry A. Caro
Adobe Systems Incorporated
Received on Friday, 16 January 2004 18:18:43 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:05:55 GMT