- From: Philip Taylor <pjt47@cam.ac.uk>
- Date: Thu, 14 May 2009 22:08:49 +0100
- To: Sam Ruby <rubys@intertwingly.net>
- CC: Shane McCarron <shane@aptest.com>, 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>
Philip Taylor wrote: >> Shane McCarron wrote: >>> [...] >>> http://www3.aptest.com/standards/rdfa-html/ > [...] > How are xmlns:* attributes meant to be processed? To elaborate: Specifications exist for XML Namespaces, but as far as I'm aware nothing exists to define the meaning or processing of similar syntax in text/html. So I'd want something somewhere to define some processing requirements vaguely like: The <def>pseudo-namespace mapping context</def> is a map from prefix strings to namespace strings, and is defined as follows: The pseudo-namespace mapping context of a Document node is the empty map. The pseudo-namespace mapping context of a DocumentFragment node is the empty map. The pseudo-namespace mapping context of an Element 'e' is computed as follows: * If the parent node of 'e' is null, let 'm' be the empty map. Otherwise, let 'm' be the pseudo-namespace mapping context of the parent node of 'e'. * For each attribute in 'e' that is in no namespace, and whose local name consists of the case-sensitive string "xmlns:" followed by a non-zero-length string of characters 'p', and whose value is not the empty string: * Update 'm' so that 'p' is mapped onto the value of the attribute. (This might replace an existing map entry.) * For each attribute in 'e' that is in the namespace "http://www.w3.org/2000/xmlns/": * Update 'm' so that the attribute's local name is mapped onto the value of the attribute. (This might replace an existing map entry.) (Note: This assumes XML parsers will insert xmlns:* attributes into the DOM, which probably isn't guaranteed.) * The pseudo-namespace mapping context of 'e' is 'm'. Where [RDFaSYNTAX] currently says: "2. Using the prefix and the current in-scope mappings, obtain the URI that the prefix maps to." replace the step with: "2. Let 'm' be the pseudo-namespace mapping context of the element with which this CURIE is associated. If the prefix is not in 'm' (case-sensitively), abort these steps and do some kind of error handling that's not defined yet. Otherwise, obtain the URI that the prefix maps to." I just made this up now so it's probably not especially correct or well-written (e.g. maybe the definition should be turned inside out), but I think it defines enough detail to determine the output of the markup examples I gave in my previous email and it generally agrees with the very rough testing I performed on some JS-based and html5lib-based RDFa implementations. -- Philip Taylor pjt47@cam.ac.uk
Received on Thursday, 14 May 2009 21:09:29 UTC