This version of the module is deprecated: Use moonbitlang/docx2html instead

    bobzhang/docx2html/xml does not have a README file

    XmlElement

    pub(all) struct XmlElement {
    name : String
    attributes : Map[String, String]
    children : Array[XmlNode]
    } derive(Eq,
    Debug
    )

    XML element with a name, attributes, and child nodes.

    XmlElement::descendants_by_tag_name

    fn XmlElement::descendants_by_tag_name(self : XmlElement, name : String) -> Array[XmlElement]

    Returns descendant elements with the requested tag.

    XmlElement::elements_by_tag_name

    fn XmlElement::elements_by_tag_name(self : XmlElement, name : String) -> Array[XmlElement]

    Returns direct child elements with the requested tag.

    XmlElement::first

    fn XmlElement::first(self : XmlElement, name : String) -> XmlElement?

    Returns the first child element with the requested tag.

    XmlElement::first_or_empty

    fn XmlElement::first_or_empty(self : XmlElement, name : String) -> XmlElement

    Returns the first matching child text, or an empty string.

    XmlElement::text

    Returns concatenated text content for the XML element.

    XmlNode

    pub(all) enum XmlNode {
    XmlElement(XmlElement)
    XmlText(String)
    } derive(Eq,
    Debug
    )

    Node in the lightweight XML tree.

    read_xml_string

    fn read_xml_string(source : String, namespace_map? : Map[String, String]) -> XmlElement raise
    DocxError

    Parses XML text into an element.

    write_xml_string

    fn write_xml_string(root : XmlElement, namespaces? : Map[String, String]) -> String

    Serializes an XML element to text.

    xml_element

    fn xml_element(name : String, attributes? : Map[String, String], children? : Array[XmlNode]) -> XmlElement

    Builds an XML element.

    xml_text

    fn xml_text(value : String) -> XmlNode

    Builds an XML text node.

    Source Files