iPE::XML::Object(3)

NAME
iPE::XML::Object - A base class for iParameterEstimation for all classes which initialize themselves with XML files.

DESCRIPTION
This is a base class which provides the functionality for a heirarchical XML parser. When a new XML::Object is invoked within an XML::Object, the current object is pushed onto a global stack, and popped off once the parse_complete method is called. Subclassed XML::Objects should implement the handle_subelement() method to take in all the nested elements below the object being created.

FUNCTIONS

new(tag, attributes, data, element)
    This method constructs a new XML object. When subclassing this class, you should call this constructor first. If you are expecting children elements, you should call handle_children at the end of your constructor.

init ()
    Empty function that should be overridden if any initialization is desired for post-XML parsing cleanup or initialization.

element ()
    Returns the XML::LibXML::Element object associated with this XML::Object.

document ()
    Get the owning document of the object.

handle_children (node)
    Goes through all subelements and passes them up to the subclass to see if it wants to do anything with it via handle_subelement

handle_subelement (tag, att, data)
    This is a stub definitions in the base class. Override this method to handle any nested elements within XML tags. For example, if your element was "cook", and you had the following structure in the document:

    <cook name="Meg">
        <helper name="Bernie" can="dance">Right hand man.</helper> </cook>

    handle_subelement would be called with the parameters ("helper", {name => "bernie", can => "dance"}, "Right hand man.")

    If the node you were passed contains subelements that you want to be contained in the current object, you may call handle_children with the node you received.

removeChildren (node)
    Removes the children of a node and returns an an array reference of copies of the children nodes.

outputPrepare (out, mode)
    Stub function in the root class. This should be overridden if you have any preparation to do before the XML::Object will be outputted. If you have a text element (PCData) associated with your object, you should set it with addPCData () or setPCData ().

getPCData ()
    Gets the parsed character data for this node.

addPCData (string)
    Adds parsed character data to the element. This does not replace any old data but rather adds to the end of the data.

setPCData (string)
    Sets the parsed character data between the tags of the element. This will replace any old data that once was in the element.

setAttribute (name, value)
    This sets the named attribute to value. Note that this will create the attribute to this element if it doesn't already exist.

createSubElement (name, parentElement)
    This creates a new element node below the parentElement node named name and returns it.

outputXML (out)
    Prints the string associated with the XML of this document.

SEE ALSO
XML::DocObject

AUTHOR
Bob Zimmermann (rpz@cse.wustl.edu)