Re: HTML and XML

Elliotte Harold wrote:
> Henri Sivonen wrote:
> 
>> So far Philip Taylor (the author of 
>> http://lists.w3.org/Archives/Public/www-archive/2009Feb/0058.html ) has 
>> found well-formedness holes in every XML-outputting system he has cared 
>> to try.
>> 
>> He even managed to make Validator.nu produce ill-formed output. The bug 
>> was in the Xalan serializer--a widely distributed library written by 
>> experts. (Astral characters were serialized as two numeric character 
>> references for the corresponding surrogates.)
> 
> Perhaps he'd care to take a whack at XOM one of these days?

Test code:

     public static void main(String[] args) {
         Element root = new Element("x", "x:&");
         Document doc = new Document(root);
         System.out.println(doc.toXML());
     }

Output from XOM 1.1:

     <x xmlns="x:&" />

The 'xmlwf' tool says: "STDIN:1:13: not well-formed (invalid token)"

(Alternate way of testing: "java nu.xom.samples.XMLPrinter 
http://philip.html5.org/misc/ampersand-in-xmlns.xml")

But that's the only well-formedness error I've been able to find so far.

-- 
Philip Taylor
pjt47@cam.ac.uk

Received on Wednesday, 11 February 2009 16:43:00 UTC