#include <skMSXMLElementObject.h>
Inheritance diagram for skMSXMLElementObject:
Public Member Functions | |
skMSXMLElementObject () | |
Default Constructor. | |
skMSXMLElementObject (const skString &location, XMLElement &elem) | |
Constructor which takes an Element. | |
~skMSXMLElementObject () | |
Destructor. | |
int | executableType () const |
Returns XMLELEMENT_TYPE indicating the element is an XMLElementObject. | |
int | intValue () const |
float | floatValue () const |
bool | boolValue () const |
Char | charValue () const |
skString | strValue () const |
bool | setValue (const skString &name, const skString &attribute, const skRValue &return_value) |
sets the value of an item in the element. | |
bool | setValueAt (const skRValue &array_index, const skString &attribute, const skRValue &value) |
Sets a value within the nth element of the XML element. | |
bool | getValue (const skString &name, const skString &attribute, skRValue &return_value) |
Retrieves a field from the XML. | |
bool | getValueAt (const skRValue &array_index, const skString &attribute, skRValue &value) |
Retrieves the nth value from within the element. | |
bool | method (const skString &name, skRValueArray &args, skRValue &ret, skExecutableContext &ctxt) |
this method attempts to execute a method stored in the XML. | |
void | copyItemsInto (XMLElement &other) |
Clears the other element and does a deep copy of the children of this node into that one. | |
virtual void | setAddIfNotPresent (bool enable) |
sets the flag controlling whether new elements are created as they are accessed | |
virtual bool | getAddIfNotPresent () |
this returns the value of the flag controlling whether new elements are created as they are accessed | |
XMLElement | getElement () |
This method returns the XML Element being held by the object. | |
void | setAttribute (skString name, const skString &value) |
Sets an attribute on this node. | |
skString | getAttribute (const skString &name) |
This method returns the value of an attribute attached to this element. | |
skString | getLocation () const |
This function returns the location associated with this object (typically a file name). | |
void | save (ostream &out) |
Call this method to save the state of the object back to a stream. | |
virtual skString | getSource (const skString &location) |
Returns the source code for the given method. | |
virtual void | getInstanceVariables (skRValueTable &table) |
This method returns the instance variables for this object. | |
virtual void | getAttributes (skRValueTable &table) |
This method returns the attributes for this object. | |
Static Public Member Functions | |
skString | getData (const XMLElement &element) |
retrieves the text data from an element | |
void | setData (XMLElement &element, const skString &data) |
sets the text data for a node by looking for the first CDATA and TEXT child node | |
XMLElement | findChild (XMLElement &parent, const skString &tagname) |
returns a child element | |
XMLElement | findChild (XMLElement &parent, int index) |
returns the nth child element | |
XMLElement | findChild (XMLElement &parent, const skString &tagname, const skString &attribute, const skString &value) |
returns a child element with the given attribute set to the given value | |
skString | getAttribute (XMLElement &elem, const skString &name) |
safely retrieves an attribute from the given element | |
skString | toString (_bstr_t &str) |
Converts an MS string to a Simkin skString. | |
_bstr_t | fromString (const skString &str) |
Converts a Simkin skString to an MS string. | |
int | countChildren (XMLElement &parent) |
this method returns the number of element children of the given element | |
Protected Member Functions | |
virtual void | setElement (XMLElement &element) |
This method updates the associated element and clears the parse tree cache. | |
virtual skMSXMLElementObject * | createXMLElementObject (const skString &location, XMLElement &element) |
This method creates a new XML Element object to wrap an element. | |
skExecutableIterator * | createIterator (const skString &qualifier) |
This function returns an skExecutableIterator object which is used in the for each statement. | |
skExecutableIterator * | createIterator () |
This function returns an skExecutableIterator object which is used in the for each statement. | |
Protected Attributes | |
skString | m_ScriptLocation |
the location that the XML document came from |
The methods getValue, setValue and method all search for matching element tags within the XML document. Only the first matching tag is used. The class uses the Xerces library to access XML documents
The class supports the following fields:
|
Constructor which takes an Element.
|
|
Reimplemented from skExecutable. |
|
Reimplemented from skExecutable. |
|
Clears the other element and does a deep copy of the children of this node into that one.
|
|
This function returns an skExecutableIterator object which is used in the for each statement. It will iterate over *all* children of this element Reimplemented from skExecutable. |
|
This function returns an skExecutableIterator object which is used in the for each statement. It will iterate over elements with the given tag.
Reimplemented from skExecutable. |
|
This method creates a new XML Element object to wrap an element. Override this for special behaviour in derived classes. In this method, the newly created object inherits this object's m_AddIfNotPresent flag
|
|
Returns XMLELEMENT_TYPE indicating the element is an XMLElementObject.
Reimplemented from skExecutable. |
|
returns a child element with the given attribute set to the given value
|
|
returns the nth child element
|
|
returns a child element
|
|
Reimplemented from skExecutable. |
|
this returns the value of the flag controlling whether new elements are created as they are accessed
|
|
This method returns the value of an attribute attached to this element.
|
|
This method returns the attributes for this object.
Reimplemented from skExecutable. |
|
retrieves the text data from an element
|
|
This method returns the XML Element being held by the object.
|
|
This method returns the instance variables for this object.
Reimplemented from skExecutable. |
|
Retrieves a field from the XML. The first sub-element matching the tag is found. The value returned is an XMLElementObject, unless the attrib value is specified. It also supports the following built-in field: "nodename" - returns the tag name of this element If the m_AddIfNotPresent flag is true, a new item will be added if one is not already present.
Reimplemented from skExecutable. |
|
Retrieves the nth value from within the element. If the array index falls within the range of the number of children of this element, a new XMLElementObject encapsulating the child is returned. If the m_AddIfNotPresent flag is true, a new item with the tag name "array_item" will be added if one is not already present Reimplemented from skExecutable. |
|
Reimplemented from skExecutable. |
|
this method attempts to execute a method stored in the XML. It searches for an element whose tag matches the method name and if found passes the text for the tag through to the interpeter. The method also supports the following methods to Simkin scripts:
Reimplemented from skExecutable. |
|
Call this method to save the state of the object back to a stream.
|
|
sets the flag controlling whether new elements are created as they are accessed
|
|
sets the text data for a node by looking for the first CDATA and TEXT child node
|
|
This method updates the associated element and clears the parse tree cache.
|
|
sets the value of an item in the element. The first sub-element matching the tag is found. If the value passed is an element, it is first copied. If the m_AddIfNotPresent flag is true, a new item will be added if one is not already present
Reimplemented from skExecutable. |
|
Sets a value within the nth element of the XML element. If the m_AddIfNotPresent flag is true, a new item with the tag name "array_item" will be added if one is not already present.
Reimplemented from skExecutable. |
|
Reimplemented from skExecutable. |