HTML XML Use Case 02

From W3C Wiki
Jump to: navigation, search

Problem statement

A user has an HTML5 toolchain and wants to process XML using familiar, powerful HTML5 tools. The larger audience for HTML5 is likely to create a tool ecosystem that developers will find compelling. They will still encounter XML, and will hope to process it using the HTML5 tools. For example, we can expect there to be HTML5 tools for doing things such as offline rendering, and web developers will want to use them with XML as well. In short, people will try to use HTML5 tools to process XML even when the tools were not designed for XML. This use case is about allowing developers of HTML-only tools to provide useful functionality to users who have non-XHTML, non-SVG, non-MathML content, even though the tool developer doesn't have a business need to address it explicitly.


The HTML5 parser will be able to parse the XML so in principle there is no parsing problem. The parser will build a DOM according to the HTML5 parsing rules. Of course, there will be issues with namespaces, but this may "just work" for many scenarios even if the the result would not meet the expectations for those who appreciate the full power of XML.


Possible Solutions

Develop tools to pre-process XML to be more consumable by HTML5 tools

Dropping namespaces and throwing out PIs might be a lot easier than converting to HTML.


XML Subset

A simpler subset of XML might be created to make life easier for the (presumably) large percentage of real world cases where the subset would suffice.

Lower Expectations

Parsing a real XML document with an HTML5 parser is probably never going to be possible. Perhaps the best we can do is set appropriate expectations.