The XML Parser.
Processing Instruction such as <?xml-stylesheet type="text/xsl" href="style.xsl"?>.
The example above is parsed as { name = "xml-stylesheet", value = "type=\"text/xsl\" href=\"style.xsl\"" }.
The value (presudo attributes) should be parsed by application.
Doc Type Declaration starting with "<!DOCTYPE".
This contains root element name and rest of details as DocTypeDefinition.
A Doc Type can be defined inline.
Node is either a element such as <a name="value">foo</a> or text such as foo.
Attribute such as name="value"
Parse XML string.
<?xml ... ?> and <!DOCTYPE ... > is optional so you don't need to ensure them.
> import XmlParser
> XmlParser.parse """<a name="value">foo</a>"""
Ok { processingInstructions = [], docType = Nothing, root = Element "a" ([{ name = "name", value = "value" }]) ([Text "foo"]) }A problem when parsing. See the elm/parser documentation for details.
Convert Xml into String.
This function does NOT insert line breaks or indents for readability.
This represents the entire XML structure.
<?xml-stylesheet type="text/xsl" href="style.xsl"?><!DOCTYPE root SYSTEM "foo.xml"><root><foo/></root>