Macaulay2 » Documentation
Packages » XML :: XMLnode
next | previous | forward | backward | up | index | toc

XMLnode -- the class of all XML trees created by the library libxml2

Description

An object of class XMLnode is a hashtable used to contain a representation of a node in an XML tree.

Each such hashtable represents a node of the tree, in which: the keys that are strings provide the values of attributes; the symbol children provides the list of children, each of which is a string or an instance of the type XMLnode; and the symbol tag provides the name of the element.

Currently, only element nodes and text nodes are implemented.

i1 : new XMLnode from {
          tag => "foo",
          children => {
               new XMLnode from {
                    tag => "bar",
                    children => { " chicken coop " } },
               " hi there ",
               new XMLnode from { tag => "bar" } } }

o1 = <foo
       <bar " chicken coop "
       " hi there "
       <bar

o1 : XMLnode

Functions and methods returning an object of class XMLnode:

Methods that use an object of class XMLnode:

For the programmer

The object XMLnode is a type, with ancestor classes MutableHashTable < HashTable < Thing.