W3C home > Mailing lists > Public > public-qt-comments@w3.org > November 2011

[Bug 14917] New: Normalization of line endings in XPath

From: <bugzilla@jessica.w3.org>
Date: Wed, 23 Nov 2011 21:32:08 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-14917-523@http.www.w3.org/Bugs/Public/>

           Summary: Normalization of line endings in XPath
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XPath 2.0
        AssignedTo: jonathan.robie@gmail.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org

XPath 2.0 (and also 3.0) contains a statement (in A.2.3 line endings) that line
endings in XPath expressions should be normalized according to the XML rules.

This is highly undesirable when XPath is embedded in XML (as for example in
XSLT and XSD), because the line ending normalization has already been done by
the XML processor. This means that it is impossible to represent a character
such as x0D: writing it as &#xD; will prevent the XML parser normalizing it
away, but this doesn't stop the XPath processor normalizing the resulting x0D
character; and since character references are not recognized in XPath, there is
no other way of expressing this character.

Furthermore, this is an undocumented incompatibility with XSLT 1.0. I suspect
the only reason this has gone unnoticed is that the major XSLT 2.0 processors
have not implemented this clause in the specification.

The statement first appeared in the draft of 15 September 2005, as a response
to bug #1307. This bug was raised against XQuery only, but the resolution that
was accepted changed both XPath and XQuery. (The decision is recorded in the
minutes of meeting 266, July 2005)

In the 7 July 2005 XQuery draft the change log states: "Removed from the main
part of the document any references to line-ending normalization. Affects 3.1.1
(Literals) and (Dir. Elem. Constructor--Content, Rule 1a). Responds to
Bug 1307. Line ending normalization will be applied globally by the parser
rather than by individual expressions."

The effect of this decision was to change line-ending normalization from being
XQuery-only to something that applied to XPath as well.

There are a number of tests in the XSLT 2.0 conformance test suite that clearly
assume writing a character reference such as &#xD will prevent end-of-ilne
normalization. Examples are satest-035 and unicode-001.

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Wednesday, 23 November 2011 21:32:14 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:47 UTC