Re: XMLLiterals and c14n

Manu Sporny wrote:
> I thought I knew what was wrong with the tests in the test suite, but
> your and Ivan's discussion has made me second guess my understanding (or
> lack thereof) of XML c14n. Could you please point out exactly what is
> wrong with the example in:
> Both of you seem to be asserting that c14n should be applied differently
> than I understand it to the example in the HTML+RDFa draft.

I believe the example output should be:

       "<rect xmlns=\"\" height=\"100\" 
style=\"fill:rgb(0,0,255);stroke-width:1; stroke:rgb(0,0,0)\" 
width=\"300\"></rect><rect xmlns=\"\" 
height=\"50\" style=\"fill:rgb(255,0,0);stroke-width:2; 

(with appropriate line-wrapping, and with the note after the example 
updated appropriately).

Since the triple is serialised as N3/Turtle, and there is no automatic 
c14n that occurs when parsing N3/Turtle, and RDF says XMLLiterals must 
be strings that are exclusive canonical XML, the string in the example 
must be exclusive canonical XML. That's basically canonical XML with all 
the redundant namespace declarations removed, and canonical XML requires 
explicit end tags and lexicographically-ordered attributes (with 
namespace declarations first), hence the changes in the example output.

(I hope I didn't make any mistakes here - I checked with some 
command-line tools and they seem to give the same output, so I think 
it's probably approximately right!)

Philip Taylor

Received on Wednesday, 16 September 2009 19:33:22 UTC