- From: Shane McCarron <shane@aptest.com>
- Date: Thu, 14 May 2009 18:58:30 -0500
- To: Laurens Holst <laurens.nospam@grauw.nl>
- CC: Tom Morris <tom@tommorris.org>, Philip Taylor <pjt47@cam.ac.uk>, Sam Ruby <rubys@intertwingly.net>, RDFa Community <public-rdfa@w3.org>, "public-rdf-in-xhtml-tf.w3.org" <public-rdf-in-xhtml-tf@w3.org>, HTML WG <public-html@w3.org>
Comments inline: Laurens Holst wrote: > Tom Morris schreef: >> As someone who has written an RDF/XML parser, an XMLLiteral is stored >> by RDF libraries as a string that's just marked as an XML literal. >> >> So, if we had <span [...property/subject declaration...] >> datatype="rdf:XMLLiteral"><a href="http://example.org/">Bla bla >> bla</a></span> >> >> This would become in N-Triples, N3 and Turtle: >> _:somesubject ex:some property """<a href="http://example.org/">Bla >> bla bla</a>"""^^rdf:XMLLiteral > > That can’t be true, you would lose namespace information. At the least > xmlns attributes should be added to that serialisation. Yes, that's correct. If the host language supports namespaces, then those MUST be added to the serialisation - they are in the XHTML profile, for example. In the case of HTML 4, there is of course no namespace support. > > On the topic of XML literals: it is obvious that RDFa in HTML content > must be parsed with an HTML parser into a DOM. This parsing algorithm > is defined in HTML5. From this DOM, HTML5 also defines an XML > serialisation. So serialising any malformed markup into an XMLLiteral > should be no problem, because the HTML parsing algorithm will have > ‘fixed it up’ into a well-formed DOM tree. True. The document I have produced is not about HTML 5 however. Moreover, RDFa does not pre-suppose a processing model in which there is a DOM. And I don't think we can. > > On a side note, I do not think putting serialised HTML into a string > is a good idea, display of such strings will include markup unless > some kind of content sniffing is done on the output, which is > undesirable. Using the textContent in such cases would be much better. In RDFa, that would be a triple where datatype was set to "" - a simple serialisation of the text nodes contained in an element. When the datatype is set to XMLLiteral, however, the contents MUST include the markup. 'cause that's what some people want. Not me you understand - I have no use for that at all. But some people ;-) -- Shane P. McCarron Phone: +1 763 786-8160 x120 Managing Director Fax: +1 763 786-8180 ApTest Minnesota Inet: shane@aptest.com
Received on Thursday, 14 May 2009 23:59:27 UTC