On 13 Nov 2003, at 04:09, Michael Smith wrote:

Stefano Mazzocchi wrote:
Hello,
I'm trying to get Apache Slide (http://jakarta.apache.org/slide/) to pass the test and it currently fails two tests:
16. prophighunicode....... FAIL (PROPPATCH of property with high unicode value)
17. propget............... FAIL (No value given for property {http://webdav.org/neon/litmus/}high-unicode)
the offending request is:
PROPPATCH /files/litmus/prop2 HTTP/1.1
Host: 127.0.0.1:10000
User-Agent: litmus/0.9.4 neon/0.24.2
Connection: TE
TE: trailers
Content-Length: 185
X-Litmus: props: 16 (prophighunicode)
<?xml version="1.0" encoding="utf-8" ?><propertyupdate xmlns='DAV:'><set><prop><high-unicode xmlns='http://webdav.org/neon/litmus/'>&#65536;</high-unicode></ prop></ set></propertyupdate>
After looking at the archives, I saw that the above tests were added by a user later down the road.
http://mailman.webdav.org/pipermail/litmus/2002-September/000021.html
After careful searching, I found that that the test is wrong since since that character is not allowed in textual content as for the XML Specification.
By taking a look at
http://www.w3.org/TR/REC-xml#CharClasses
you clearly see that &#65536; which is equivalent to &#xD800; is not a valid XML character, as Slide correctly reports (thru an error signaled by the underlying JDOM library)

&#65536; is equivalent to &#x10000;, not &#xD800.

D'oh! I should not do debugging at 4:30AM! You are totally right!

It's a perfectly reasonable and valid character. See section 2.2 of the XML spec at: http://www.w3.org/TR/REC-xml#charsets

Specifically: "Consequently, XML processors must accept any character in the range specified for Char", and

Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] /* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */

Note that this precludes using surrogates to encode these 'high unicode' values - so you have to do it this way (a Java parser's internal format will, I think, use surrogates, however).

Note that currently Slide returns a 500 (internal server error), but I'm going to patch it to return a 400 (Bad Request) and I would suggest the Litmus tests to be changed accordingly, expecing a 400 on the above request.

As described above, it's a valid request, Slide should handle it.

Your error is solely in how you got from &#65536; to &#xD800; - I'm not sure what you did, or if you just (incorrectly) trusted the value that slide was reporting as an error.

I did. So this is definately a JDOM bug now.

Sorry for the noise :-(

--
Stefano.

Attachment: smime.p7s
Description: S/MIME cryptographic signature



Reply via email to