[8:6] static
extends: object
Defines the XML types in this enum.
[28:21] static
(extern: com.lehman.aussom.stdlib.AussomXml) extends: object
XML class implements various functions for working with XML. It implements parse, toXml, and helper functions for creating XML nodes.
parse (string XmlString
)
Parses the provided XML string and returns an Aussom structure with the result.
toXml (map XmlStructure, bool Pretty = true, bool Strict = false
)
Converts the provided Aussom XML structure of maps and lists and returns an XML encoded string. Note that this function will attempt to create the XMl but will throw an excpeiton if it gets to a spot where it can't continue.
XmlStructure
is a map with the XML document to convert.Pretty
is a bool with true for pretty print and false for not.Strict
is a bool with true for strict mode and false for not. If not strict mode, the function will make it's very best effort to convert the XML without exception. This means that it may not convert parts that are invalid.A
string with the XML encoded content.newNode (string Name, string Type = "ELEMENT"
)
Creates a new XML node structure. This is a help function and it just returns a map with the strucure built. You can build the structure and then provide this to the toXml function that builds XML from it.
Name
is a string with the node name.Type
is a string with the XML node type. See xmltype enum for options.A
map with the new node structure.newCdata (string Text
)
Creates a new CDATA section node and returns it.
A
map with the node.newDoc ()
Creates a new document node and returns it.
A
map with the node.