Re: Test 0198 - XHTML1/XHTML5 - XMLLiteral & prefixes

On Jul 2, 2014, at 3:08 PM, Alex Miłowski <alex@milowski.com> wrote:

> I have been looking at testing 0198 for XHTML1/XHTML5 as my produced
> literal doesn't not include the same set of XML namespace
> declarations.
> 
> The test case input are at [1],[2].  In both inputs, the "rdf:" and
> "foaf:" prefixes are declared via a prefix attribute.  As they are not
> XML namespace attributes (e.g. xmlns:rdf or xmlns:foaf), they won't be
> included in the serialization.
> 
> I looked at the specification [3] and I don't see anywhere were it
> says that the prefixes declared via other mechanism should be turned
> into XML namespace attributes.  Meanwhile, the expected test output
> [4],[5] have them in the XMLLiteral value.  My implementation doesn't
> no mess with the automatic XML serialization it gets from the
> browser's serializer.
> 
> I believe the tests are incorrect in this regard.
> 
> While adding extra namespaces doesn't not necessarily hurt the
> serialized markup, there is a burden placed on implementors to keep
> track of the in-scope prefixes and namespace declarations for the
> literal value when they defer serialization.  In my case, the XML
> nodes are kept instead of a literal value and I only serialize on
> demand.
> 
> Again, I don't see anywhere in the RDFa 1.1 specification where it
> says I must merge the prefixes and in-scope namespaces for XMLLiteral
> values.

I think you're correct; note that neither the Ruby, nor Ivan's pyRDFa implementations  add prefixes as namespaces either. The fact that the SPARQL test is passed is due to laxness in my own XMLLiteral comparison. XML C14XL is almost impossible to get right, and is a big reason that RDF 1.1 includes the rdf:HTML datatype, which is much more useful, IMO.

Fixing the SPARQL results to exclude the xmlns:foaf and xmlns:rdf definitions from the span elements within the literal should be the right way to go, although it would be re-writing history.

Gregg

> [1] http://rdfa.info/test-suite/test-cases/rdfa1.1/xhtml1/0198.xhtml
> [2] http://rdfa.info/test-suite/test-cases/rdfa1.1/xhtml5/0198.xhtml
> [3] http://www.w3.org/TR/rdfa-syntax/#PS-current-object-literal
> [4] http://rdfa.info/test-suite/test-cases/rdfa1.1/xhtml1/0198.sparql
> [5] http://rdfa.info/test-suite/test-cases/rdfa1.1/xhtml5/0198.sparql
> 
> -- 
> --Alex Milowski
> "The excellence of grammar as a guide is proportional to the paucity of the
> inflexions, i.e. to the degree of analysis effected by the language
> considered."
> 
> Bertrand Russell in a footnote of Principles of Mathematics
> 

Received on Wednesday, 2 July 2014 22:34:27 UTC