File Xml.lua

Functions

Xml:new (t) Constructor for new instance.
Xml:newClass (t) Constructor for extending class.
Xml:parseXml (xmlString) Load xml string into xml table.
Xml:serialize (xmlTable, omitDecl) Converts xml table to string, typically for writing to a file upon return.


Functions

Xml:new (t)
Constructor for new instance.

Parameters:

  • t:
Xml:newClass (t)
Constructor for extending class.

Parameters:

  • t:
Xml:parseXml (xmlString)
Load xml string into xml table.

Parameters:

  • xmlString: Typically as read from file, but could be manufactured...

Usage:

  • Table Entry Format: - type, name, attrs, text.
  • returned table can be modified, then re-written. 

Return value:

    tree-structured table with one entry per corresponding xml node.
Xml:serialize (xmlTable, omitDecl)
Converts xml table to string, typically for writing to a file upon return.

Parameters:

  • xmlTable: As read originally from by parse-xml method.
  • omitDecl: boolean: true iff xml declaration sometimes present on line one is to be omitted.

Usage:

    Serializes in multi-line format, like xmp files. 

Valid XHTML 1.0!