- From: <bugzilla@wiggum.w3.org>
- Date: Thu, 28 Sep 2006 21:47:03 +0000
- To: public-qt-comments@w3.org
- CC:
http://www.w3.org/Bugs/Public/show_bug.cgi?id=2441
------- Comment #15 from davidc@nag.co.uk 2006-09-28 21:47 -------
> Well, it seems that the resolution of entity references and character
> references is not clearly defined...
I honestly am struggling to see any ambiguity in the current specification
and so I'm not sure I can really answer your questions in a helpful way but
I'll try.
> "Each predefined entity reference is replaced by the character it represents
> when the string literal is processed."
There are five predefined entities, including amp and that means that &
gets replaced by an ampersand character. The whole point of writing &
rather than & is to _stop_ it being used as markup so it is absolutely clear
that in XQuery as in XML
&#1234;is the 7 characters 7 # 1 2 3 4 ; not a reference to the character
with codepoint 1234. It would be absolutely bizare if Xquery were defined
otherwise, as it would be using XML syntax with completely different semantics.
> Are string-length("abc𝅖def") and string-length("abc&#x1D156;def")?
> at least one XQuery processor I tried resolves these two strings to the same
> string value,
bugs happen, report it as a bug to that system's maintainers, That is
unquestionably a bug.
> So which characters should be replaced by entity refs when producing XQueryX?
> Seems that the stylesheet assumes ",',<,> should be replaced but not &?
as always when writing xml (or xml-like) syntax you just need to quote those
characters that have special significance in XML, which includes &, and this is
what the stylesheet does, see the template name="quote" which
<xsl:with-param
name="toBeReplaced">&</xsl:with-param>
<xsl:with-param
name="replacement">&amp;</xsl:with-param>
David
Received on Thursday, 28 September 2006 21:47:09 UTC