W3C home > Mailing lists > Public > www-ql@w3.org > October to December 2004

Entities in predicates

From: Steve Condas <scondas@yahoo.com>
Date: Tue, 5 Oct 2004 12:02:32 -0700 (PDT)
Message-ID: <20041005190232.31332.qmail@web52601.mail.yahoo.com>
To: www-ql@w3.org
I am new to XPath/XQuery, so please forgive my ignorance.  I am caught between multiple interpretations of XPath/XQuery StringLiteral that are causing be development difficulties.  I have an XML element that contains an entity (e.g. <Railroad>B&O</Railroad>), and I am trying to find that element using two different tools.  In one tool, Java/Jaxen, I must use a predicate of the form [. = 'B&O'] to select the node.  In another tool, NeoCore XMS I must use a predicate of the form [. = 'B&amp;O'] to select the node.  Finally, I have found that the Mark Logic XQuery engine will accept either predicate phrasing and return the desired node.
I have examined the EBNF for XPath 1.0,  XPath 2.0 (Draft), and XQuery 1.0 (Draft).  For the two XPath specs, the EBNF for StringLiteral is:
('"' (('"' '"') | [^"])* '"') | ("'" (("'" "'") | [^'])* "'")
The XQuery EBNF is:
('"' (PredefinedEntityRef | CharRef | ('"' '"') | [^"&])* '"') | ("'" (PredefinedEntityRef | CharRef | ("'" "'") | [^'&])* "'")
Should the XPath 2.0 and XQuery 1.0 EBNF for StringLiteral be identical?  Which of my three tools (Jaxen, NeoCore, MarkLogic) is implementing the target spec correctly?  From a developers perspective, it seems as though the Mark Logic implmentation is the ideal behavior since I don't have to expand entities to entity references before submitting my query.
Thanks in advance,
Steve Condas
Received on Tuesday, 5 October 2004 19:03:02 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:43:43 UTC