next | previous | forward | backward | up | top | index | toc | Macaulay2 website
XML :: toXMLnode(LibxmlNode)

toXMLnode(LibxmlNode) -- convert an object of type LibxmlNode to a hashtable of type XMLnode

Synopsis

Description

This function translates an XML tree created by the libxml library into a tree of hash tables of type XMLnode.

i1 : n = xmlParse ///<foo a="hi there">  ho there  <bar/></foo>///

o1 = <foo a="hi there">  ho there  <bar/></foo>

o1 : LibxmlNode (xmlTypeDescription)
i2 : x = toXMLnode n

o2 = <foo a="hi there"
       "ho there"
       <bar

o2 : XMLnode
i3 : peek'_3 x

o3 = XMLnode{"a" => "hi there"                              }
             children => {"ho there", XMLnode{tag => "bar"}}
             tag => "foo"
i4 : x#"a"

o4 = hi there
i5 : x.children

o5 = {ho there, <bar}

o5 : List
i6 : class \ oo

o6 = {String, XMLnode}

o6 : List
i7 : x.tag

o7 = foo
i8 : x = toXMLnode(n,Trim=>false)

o8 = <foo a="hi there"
       "  ho there  "
       <bar

o8 : XMLnode

See also