Project

Profile

Help

Maintenance: Planio will be observing a scheduled maintenance window this Tuesday, November 5, 2024 from 03:00 UTC until 06:30 UTC to perform urgent network maintenance in our primary data center. Your Planio account will be unavailable during this maintenance window.

Question on end-of-line handling

Added by Anonymous over 19 years ago

Legacy ID: #3232389 Legacy Poster: marcvc (marcvc)

Michael, Consider the following XQuery: string-length(<foo>a&#xD;&#xA;b</foo>) , string-length(<foo>{"a&#xD;&#xA;b"}</foo>) , string-length(<foo>a b</foo>) , string-length(<foo>{"a b"}</foo>) Saxon evaluates to: 4 4 3 4 I had some discussion on this over here, and we don't seem to come to an agreement. Personally I would have expected 3 3 3 3 (considering XML end-of-line handling and translating #xD;&#xA; to a single #xA). Can you explain Saxon's behaviour? I do understand that this might well be seen as more an XQuery spec than Saxon specific question. In which case I will contact the W3C XQuery WG. Thanks, Marc


Replies (1)

RE: Question on end-of-line handling - Added by Anonymous over 19 years ago

Legacy ID: #3232440 Legacy Poster: Michael Kay (mhkay)

Saxon isn't implementing the end-of-line rules as defined in the April draft - when I looked at the spec I decided that the rules were nonsense as written, and made a proposal to change them, which has been accepted. Saxon 8.5 will implement the new rules, which essentially work just like XML: "real" line endings in the query are normalized to a single xA character before any other parsing is done, while character entities are not touched. This means the correct result is (4 4 3 3). Michael Kay

    (1-1/1)

    Please register to reply