W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > October 2010

XMLLiterals and Exclusive XML Canonicalization

From: Gregg Kellogg <gregg@kellogg-assoc.com>
Date: Fri, 22 Oct 2010 19:52:23 -0400
To: RDFa WG <public-rdfa-wg@w3.org>
Message-ID: <C4504464-EB97-4341-BEE9-AF8B20A86A75@kellogg-assoc.com>
I raise a couple of issues here:

 *   Problems with @xmlns propogation to XMLLiterals given Exclusive Canonical XML rules
 *   Potential need to keep @prefix and @xmlns separate in Evaluation Context
 *   Need to keep in-scope @profiles in Evaluation Context

The Note in 7.5 step 11, establishing a current object literal, indicates that all in-scope profiles, default vocabulary, prefix mappings and namespace declarations are replicated on top-level elements within the document fragment to be serialized, with some provisions. It also is defined to be Exclusive Canonical XML. However, my reading of [1] is that only namespaces utilized by rendered nodes are emitted. Thus, any namespaces declared using @xmlns:xxx which were used only as part of an RDFa attribute would not be included in the Canonical representation.

Consider the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" version="XHTML+RDFa 1.1"
<title>Test 0198</title>
<base href="http://www.example.org/me" />
      <div id="mark" about="#mark" typeof="foaf:Person">
        <h2 property="foaf:name" datatype="rdf:XMLLiteral"><span
property="foaf:firstName">Mark</span> <span

I believe this should generate the following:

@base <http://rdfa.digitalbazaar.com/test-suite/test-cases/xhtml11/0198.xhtml> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<http://www.example.org/me#mark> a foaf:Person;
   foaf:firstName "Mark";
   foaf:name "<span xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\" property=\"foaf:firstName\">Mark</span> <span xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\" property=\"foaf:surname\">Birbeck</span>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>;
   foaf:surname "Birbeck" .

But Exclusive Canonical XML would eliminate the  xmlns:foaf=\"http://xmlns.com/foaf/0.1/\"

If mappings were made using @prefix instead of @xmlns, this wouldn't be as much of an issue. However, a processor would either need to parse the contents to determine which prefix mappings are required, or output all definitions whether from @prefix or @xmlns using @prefix notation (unless ECX caused an @xmlns to be emitted). This might generate the following, instead:

@base <http://rdfa.digitalbazaar.com/test-suite/test-cases/xhtml11/0198.xhtml> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<http://www.example.org/me#mark> a foaf:Person;
   foaf:firstName "Mark";
   foaf:name "<span xmlns=\"http://www.w3.org/1999/xhtml\" prefix=\"foaf: http://xmlns.com/foaf/0.1/\" property=\"foaf:firstName\">Mark</span> <span xmlns=\"http://www.w3.org/1999/xhtml\" prefix=\"foaf: http://xmlns.com/foaf/0.1/\" property=\"foaf:surname\">Birbeck</span>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>;
   foaf:surname "Birbeck" .

Is there any expectation that @xmlns mappings and @prefix mappings be kept distinct? This would imply some added processing steps when maintaining Evaluation Contexts.

Same for @profile, which must be passed along. This requires that @profile entries be maintained in proper order in the Evaluation Context so that they can be passed to the XMLLiteral serialization. This implies some more exposition in the processing steps to make it clear what and how these should be handled. For example:

<div profile="a b">
  <span profile="d e" property="foo" datatype="rdf:XMLLiteral>

Would need to remember the order "d e a b" so that they would be processed in order, and generate "<span profile=\"d e a b\"></span>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>


[1] http://www.w3.org/TR/2002/REC-xml-exc-c14n-20020718/#sec-Specification
Received on Friday, 22 October 2010 23:53:31 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:05:22 UTC