-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Nico Kutscherauer edited this page Oct 17, 2024
·
16 revisions
The X(ML)² - or XmlML - structure enables to work on an XML document nodes (XDM tree) but also enables to reconstruct each character of the origin XML syntax.
The project provides an XML parser, serializer and XDM tree converter and an XPath evaluation engine as XSLT function library.
<?xml version="1.0" encoding="UTF-8"?>
<foo>
<bar a='value'>baz</bar>
</foo>
The above XML is parsed to the following X(ml)² tree:
<document xmlns="http://www.nkutsche.com/xmlml" line-feed-format="n">
<xml-decl>
<version>
<ws space="1"/>
<name/>
<eq/>
<value>
<data>1.0</data>
</value>
</version>
<encoding>
<ws space="1"/>
<name/>
<eq/>
<value>
<data>UTF-8</data>
</value>
</encoding>
</xml-decl>
<ws nl="1"/>
<element>
<name>foo</name>
<content space="preserve">
<text>
<nl/>
<data> </data>
</text>
<element>
<name>bar</name>
<attribute>
<ws space="1"/>
<name>a</name>
<eq/>
<value quotes="single">
<data>value</data>
</value>
</attribute>
<content space="preserve">
<text>
<data>baz</data>
</text>
</content>
</element>
<text>
<nl/>
</text>
</content>
</element>
</document>