HTML XML Use Cases

From W3C Wiki
Revision as of 13:39, 21 January 2011 by Avankest (Talk | contribs)

Jump to: navigation, search

The following initial use cases have been identified.

Generating XML using string-concatenation

The way most authors generate HTML is by simply concatenating strings together. WordPress, the software behind Wikipedia, and many many other projects on the web work this way. Producing HTML in this way is very easy. The only thing you need to know are variables and "echo". Generating HTML this way is also guaranteed to lead to subtle errors at times. E.g. an ampersand that is not escaped or a missing end tag.

To do XML you really need to produce it by serializing a tree. Otherwise you are bound to bump into subtle bugs, such as unexpected Unicode characters. However, this means that producing XML is much more complicated than producing HTML. You need to have a tree model that you can manipulate, a serializer for that tree model, and maybe some other associated tools. This makes XML too hard for typical authors.

Potential solution: "XML5"

If XML is "replaced" by a fully backwards compatible version of XML that never fails with parsing the requirements on authoring XML will be much simpler since mistakes are tolerated. [1]