Re: several messages about New Vocabularies in text/html

On Apr 2, 2008, at 04:57, Ian Hickson wrote:
> I have been unable to come up with a generic syntax for vocabulary
> extension that looks (even slightly) like XML and that would  
> actually work
> in practice on the Web.


Could you please elaborate why the following won't work? In  
particular, would the following breaks such a large mass of pages as  
to Break The Web? (Especially if the rendering rules for MathML are  
adjusted so that text children of <math> are rendered like text  
children of an HTML <span>.)

The following elements are defined as 'namespace-sensitive':
  <html>
  <svg>
  <math>
  <foreignObject>
  <annotation-xml encoding="application/xhtml+xml">
  <annotation-xml encoding="OpenMath">.

Namespace-sensitive elements have two namespace URIs associated with  
them: self and scope.

Thus:
  <html>
    self: http://www.w3.org/1999/xhtml
    scope: http://www.w3.org/1999/xhtml
  <svg>
    self: http://www.w3.org/2000/svg
    scope: http://www.w3.org/2000/svg
  <math>
    self: http://www.w3.org/1998/Math/MathML
    scope: http://www.w3.org/1998/Math/MathML
  <foreignObject>
    self: http://www.w3.org/2000/svg
    scope: http://www.w3.org/1999/xhtml
  <annotation-xml encoding="application/xhtml+xml">
    self: http://www.w3.org/1998/Math/MathML
    scope: http://www.w3.org/1999/xhtml
  <annotation-xml encoding="OpenMath">
    self: http://www.w3.org/1998/Math/MathML
    scope: http://www.openmath.org/OpenMath

The namespace of a element node to be inserted is determined as follows:
  1) If the node to be inserted is an namespace-sensitive element, use  
the value for 'self' in the above list and abort these steps.
  2) Let 'node' be the current node on the stack of open elements.
  3) If 'node' is a namespace-sensitive element, use the value for  
'scope' in the above list and abort these steps.
  4) Let 'node' be the next node on the stack of open elements towards  
the root element.

(Of course, the repeated stack walking should be optimized away.)

The /> empty element syntax should be supported on start tag tokens  
(node popped immediately) whose namespace doesn't resolve to http://www.w3.org/1999/xhtml 
  according to the above rule.

When the stack is pushed/popped, the namespace of the current node  
must be inspected. If it is http://www.w3.org/1999/xhtml, the  
tokenizer must be set not to support CDATA sections. Otherwise, the  
tokenizer must be set to support CDATA sections.

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/

Received on Wednesday, 2 April 2008 14:22:41 UTC