w3c / qtspecs

XSLT and XQuery Specifications - the source used to build the specs, and the errata
Other
30 stars 25 forks source link

Line ending normalization in XQuery source code #61

Closed michaelhkay closed 6 months ago

michaelhkay commented 6 months ago

XQuery 1.0 mandated that line endings are normalized within string literals and within element constructor content (which are the only places where it matters, since everywhere else whitespace has no effect except as a separator).

The relevant sentences were dropped in XQuery 3.0. This fact isn't mentioned in the "changes" or "incompatibilities" appendices of the specs, despite the fact that it's a noteworthy change to the semantics of a query. It's not at all clear why the change should have been made. Perhaps the idea was to move it, so that instead of being a particular behaviour for string literals and element constructors, it should be done for the query as a whole? If so, the text seems to have been lost in transit.

Note: there are tests in the test suite that will only pass if line endings are normalized, and no-one appears to have queried these.

michaelhkay commented 6 months ago

The text has moved: the provision for normalization of line endings is now in Appendix A2.3. The history of how it changed can be found at https://www.w3.org/Bugs/Public/show_bug.cgi?id=14917