Chapter 3Parsing inputs

The grammar parsing functions return a function that will parse an input string. The parsing function returns an XML document (or a map). If the parse is successful, this will be a representation of the result of parsing the input with the grammar.

If the parse is unsuccessful, a top-level ixml:state attribute (or property) with the value “fail” indicates that the parse did not succeed. The rest of the document will contain information that is designed to help you identify the error.

The parser will not load a URI for you. If you want to parse an external document, load it with unparsed-text and pass the resulting string to the parser.