To best demonstrate the ease of this conversion from XML, here are some examples of XHTML in with an XML-to-JsonML XSLT applied to them. View source to see the input before the web browser applies the transformation:
Elements are supported directly in the grammar as a first class concept.
Attributes are supported directly in the grammar as a first class concept.
Text nodes are supported directly in the grammar as a first class concept.
Namespace nodes themselves do not directly appear in the output. Namespace prefixes may be included right in the tag-name string (e.g. "myns:my-tag"). Resolving these to their URI follows the same syntax as in XML via an "xmlns" or "xmlns:prefix" attribute where the URI is specified as the value.
The reference XML-to-JsonML XSLT explicitly removes the namespace prefix from any element or attribute within the XHTML namespace. The reason being that when used in combination with the reference JsonML UI Builder, the DOM is expecting namespace free HTML elements.
The inclusion of namespace support in JsonML is to enable a wider range of uses beyond that of HTML markup.