Defining rdf:XMLLiteral in terms of the DOM

Off-list, Ivan and me have explored different possible definitions of the rdf:XMLLiteral value space, considering different formalisms for defining XML documents (XML infosets, DOM trees, etc). Below is a modification of the previous proposal. It expresses the same value space, but in terms of the DOM instead of XML infosets.

Value space:

[[
The value space contains sets of DocumentFragments [DOM3]. Two DocumentFragments A and B are of the same value if and only if the DOM method A.isEqualNode(B) returns true.
]]

L2V mapping:

[[
The lexical-to-value mapping is defined as follows:
* Let xmldoc be the lexical form wrapped between an arbitrary XML start-tag and matching end-tag (an XML document [XML10])
* Let domdoc be a DOM Document object [DOM3] corresponding to xmldoc
* Return a DocumentFragment whose childNodes attribute is equal to the childNodes attribute of domdoc's documentElement attribute
]]

The relevant definitions are:

  • DocumentFragment: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-B63ED1A3
  • Node.isEqualNode: http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isEqualNode
  • Node: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1950641247

Everything else would remain as in the previous proposal (datatype is optional; the lexical space doesn't require canonicalization but requires well-formedness). The previous proposal for rdf:XMLLiterals was here:
http://lists.w3.org/Archives/Public/public-rdf-wg/2012May/0006.html
With more background:
http://www.w3.org/2011/rdf-wg/wiki/XML_Literals

The advantages of the DOM-based definition are:

  • A very well-defined notion of equality
  • Readily available off-the-shelf implementations
  • HTML5 is also defined in terms of the DOM

Best,
Richard

Received on Wednesday, 9 May 2012 14:55:09 UTC