W3C home > Mailing lists > Public > public-qt-comments@w3.org > September 2006

[Bug 2441] xqx: character references

From: <bugzilla@wiggum.w3.org>
Date: Thu, 28 Sep 2006 17:27:30 +0000
CC:
To: public-qt-comments@w3.org
Message-Id: <E1GSzfW-0006kI-4K@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=2441





------- Comment #13 from maxim.orgiyan@oracle.com  2006-09-28 17:27 -------
(In reply to comment #12)
> >  since it's not clear what the behaviour should be.
> 
> I do not see any ambiguity in the current spec, what ambiguity do you see?
> 
> string literals in XQueryX should just encode the string in XML not the XML
> encoding of  the XQuery encoding of the string. so the string of length 1
> consisting of an ampersand is encoded as &amp; not as &amp;amp;
> The implementation in xqueryx.xsl also requires this, it is easy to check by 
> running xqueryx.xsl on any of the xqueryx files listed in comment #9 that the
> resulting XQuery is not equivalent to the original XQuery file in the test
> suite.
> 
> David
> 

Well, it seems that the resolution of entity references and character
references is not clearly defined...

XQueryX spec 3.1.1 says:

"Each predefined entity reference is replaced by the character it represents
when the string literal is processed."

For example, take surrogates01.xq that you mention as one of the
files having the problem.

The XQueryX we currently generate for this includes
the escaped & character:

                      <xqx:stringConstantExpr>
                        <xqx:value>abc&amp;#x1D156;def</xqx:value>
                      </xqx:stringConstantExpr>

The stylesheet converts the XQueryX to:

string-length("abc&amp;#x1D156;def")

Are string-length("abc&#x1D156;def") and string-length("abc&amp;#x1D156;def")?
That would depend on the rules for resolving entity refs and character refs...
at least one XQuery processor I tried resolves these two strings to the same
string value,
and returns the same answer for both these queries: 7.

So what are the exact rules for the resolution of entity refs and character
refs?
Received on Thursday, 28 September 2006 17:27:34 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:15 UTC