ICI Modules: xml: in-memory document structure
Modules by name : by typeOverview
The stream is returned as an ordered collection of objects. Each is either an element of some kind or character data. Elements themselves contain an ordered collections of nested elements. There is no limit to nesting. Elements also contain a number of attributes which are stored as key/value pairs with both keys and values being strings.
Each element is represented as a struct object with a number of key/value pairs. Element attributes appear as string keys that map to strings storing the value of the attribute as presented in the stream. Element meta-data is stored using non-string keys to avoid clashes with the data stream's choice of names. The keys are integers but could be anything other than strings,
- xml.ELEMENTS
Maps to an array of nested elements. Each is a struct, the same as this element.
- xml.TAG
Maps to a string, the XML tag for this element.
- xml.ID
Maps to a parser assigned identifier number for this element. Each element is assigned a number, unique for the XML stream being parsed. This is not used in any way by this module but may be of use by users (it was added during debugging and never removed).
Additionally the "super" of a nested element struct is set to the parent element allowing programs to traverse upwards as well as downwards. Programs need to be careful when setting element attributes that they do not follow the super-struct chain, the standard assign() function should be used in this case.