UXML is a non-validating XML parser for Standard ML.
- open UXML.Path; infix |>;
...
- val doc = UXML.parseString "<r><c><c1/><c1/><c3>abc</c3></c><d><d1>ccc</d1>ddd</d></r>";
val doc =
[Element
{attributes=[],contents=[Element #,Element #],name="r",nsprefix=NONE}]
: UXML.content list
- UXML.Path.fromDocument doc |> child "r" |> child "c" |> child "c1" |> get;
val it =
[Element {attributes=[],contents=[],name="c1",nsprefix=NONE},
Element {attributes=[],contents=[],name="c1",nsprefix=NONE}]
: UXML.content list
UXML can parse all valid/invalid XML files in
XML W3C Conformance Test Suite
except for non-UTF8 files and files including a character >= 𐀀
.
UXML produces correct Canonical XML files for all valid/invalid files in the test suite as a non-validating XML processor. ('correct' here means 'it behaves same as expat')
UXML | fxp | XML from smlnj-lib | |
---|---|---|---|
validation against DTD | No | Yes | No |
DTD recognition | Yes | Yes | No |
namespace | Yes | No | No |
XPath-like navigation API | Yes | No | No |
- an SML implementation with SML/NJ Library (smlnj-lib) and ML Language Processig Tools (ml-lpt)
- proglr command
If you do not want to install proglr, either use releases or use UXML from Smackage, since they contain files generated by proglr.