W3C home > Mailing lists > Public > public-xml-er@w3.org > February 2012

Re: Two Specs and Test Suite

From: Robin Berjon <robin@berjon.com>
Date: Mon, 27 Feb 2012 21:54:46 +0100
Cc: W3C XML-ER Community Group <public-xml-er@w3.org>
Message-Id: <1711F794-0A0E-4A14-8731-5E42352EF4FE@berjon.com>
To: Noah Mendelsohn <nrm@arcanedomain.com>
On Feb 27, 2012, at 21:42 , Noah Mendelsohn wrote:
> On 2/27/2012 3:24 PM, Robin Berjon wrote:
>> I think that the hard part in testing this is to do so in a manner that is friendly to both browser and batch environments. In the former, the easiest is to run assertions against the DOM that's produced, but in the latter it's likely to produce some form of canonical version (which doesn't have to be C14N  for instance PYX has historically been great for testing) or use some form of XML diff facility.
>> 
>> I don't think that there are any in-browser XML diff facilities, and it's not clear that there's a reliable XML serialiser we could use there. The simplest might therefore be to use PYX-based reference interpretations and those could be compared in either situation. But that's just one way that it could work and is entirely based on what I assume implementers will find most useful.
> 
> It occurs to me that, at least for testing purposes, the XML Canonicalization specification [1] may be a useful building block. I suspect one might have to add a few rules beyond what it standardizes, but if you serialize two DOMs and then canonicalize, you're probably pretty far along toward having strings that can be compared character-for-character. Of course, if we decide to specify XML-ER at the source level after all, then one can skip the serialization step, and for texting just use C14N(suitably enhanced) and string compare.

That's certainly an option, but my concern would be the implementation cost for the test suite. I'm not aware of any JS implementation of C14N and I'm not confident that we'd get raving crowds gathering to work on it. That's why I'd suggest that something like PYX[0] (or ESIS, for those who recall that) would be simpler. Offer me a cup of tea and I'll write a DOM to PYX serialiser  it's really not much work.

[0] http://www.xml.com/pub/a/2000/03/15/feature/index.html

-- 
Robin Berjon - http://berjon.com/ - @robinberjon

Coming up soon: I'm teaching a W3C online course on Mobile Web Apps
http://www.w3devcampus.com/writing-great-web-applications-for-mobile/
Received on Monday, 27 February 2012 20:55:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 February 2012 20:55:18 GMT