Re: A couple of XMLLiteral-related questions.

Good question... But I really wonder whether we could/should specify this without creating problems for implementers.

A reasonable implementation strategy is, after all, to let an xml parser parse the whole RDFa file and then operate on the resulting, internal representation of the the DOM tree. (This is certainly what I do.) Handling an XML literal becomes the issue of taking a subtree and generate some literal out of it by serializing back into XML.

So the question is: do all xml parsers retain the comments in the resulting DOM tree? Is that specified? Because if this is left unspecified by XML (I must admit I did not check) and/or if widely used XML toolsets remove the comments, then we should not prescribe this behavior and leave it open.

(B.t.w., my implementation, that works exactly along those lines, does _not_ generate the comments because the basic xml parser of Python that comes with all distribution swallows them.)

Ivan



On Apr 16, 2010, at 18:36 , Toby Inkster wrote:

> I think the RDFa 1.0 spec is silent on these; it would be nice if RDFa
> 1.1 could give some unambiguous answers.
> 
> Firstly, given:
> 
> 	<p property="ex:foo"><!--hello--><b>world</b></p>
> 
> Should the literal be:
> 
> 	'<!--hello--><b xmlns="http://www.w3.org/1999/xhtml">world</b>'
> 
> Or should it be:
> 
> 	'<b xmlns="http://www.w3.org/1999/xhtml">world</b>'
> 
> That is, do we include comments in the canonicalisation XMLLiteral? In
> RDF/XML they are included, but that's a serialisation-specific decision;
> we could decide to specify it the other way.
> 
> Secondly, given:
> 
> 	<p property="ex:foo"><!--hello-->world</p>
> 
> Is the presence of the comment enough to trigger the generation of an
> XMLLiteral, or should a plain literal be generated instead?
> 
> For what it's worth, the current behaviour of my parser is to include
> comments in XMLLiterals, but for the presence of a comment to not
> trigger generating an XMLLiteral.
> 
> -- 
> Toby A Inkster
> <mailto:mail@tobyinkster.co.uk>
> <http://tobyinkster.co.uk>
> 
> 


----
Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
PGP Key: http://www.ivan-herman.net/pgpkey.html
FOAF: http://www.ivan-herman.net/foaf.rdf

Received on Saturday, 17 April 2010 06:17:17 UTC