XMLCom



This document is a brief overview of the properties, methods and events of the various interfaces contained in the XML COM Server - Note that these interfaces also are part of the JabberCOM Server (JabberCOM.DLL).

For examples checkout the XMLCOM examples page.

If you have bugs, please use bugzilla at http://bugs.jabber.org Register them in the jabberoo section.

IXMLNode
This Interface is the BASE class for many of the other xml elements listed below. It is mostly used when dealing with the IXMLIterator interface (See below).

Properties

IXMLCData
The element which contains basic text inside of an XMLTag. The text can be escaped or not. If the text IS NOT escaped, the Name property will be '#NAME', otherwise it will be '#CDATA'. Check the XML standards for more about the differences.

Properties

IXMLTag
The main interface which deals with a simple or complex XML tag. This object can have many "embedded" elements. Each element can be any type of XMLNode descendant. The XMLTag interface uses the IXMLIterator interface to "traverse" the element stack.

Properties

Methods

Clear
Clears out all of the child nodes and resets all properties for this XMLTag.
HasTags [boolean]
Does this tag have other XMLTag elements inside of it?
HasCData [boolean]
Does this tag have XMLCData elements inside of it?
Query(search: string) [IXMLIterator]
Returns a new XMLIterator interface which will find all of the child nodes/elements which have a name which match the search criteria.
QueryTag(search: string) [IXMLTagIerator]
Returns a new iterator interface which contains all of the TAGS which match the search string.
AddCData(text: string) [IXMLCData]
Add a new XMLCData element which contains the given text and returns the interface to it.
AddTag(name: string) [IXMLTag]
Add a new XMLTag with the specified name and return an interface to it.
AddBasicTag(TagName: string; TagData: string) [IXMLTag]
Add a new XMLTag with the specified name, then add a new CData tag to _THAT_ new tag using the specified TagData string. Returns the interface to the added XMLTag object.
PutAttrib(AttribName: string; AttribValue: string) [IXMLAttrib]
Adds a new attribute to this XMLTag using the specified values. Returns an interface to the new element.
GetAttrib(AttribName: string) [string]
Returns the associated value for the given attribute name. If the Attribute does not exist, an empty string is returned.
DelAttrib(AttribName)
Remove the specified Attribute from this tag.
AssignTag(xml: IXMLTag)
Make this tag be a duplicate of the one passed in the xml parameter.

IXMLIterator
Use this object to iterate through a series of XMLNodes. Note that when a property or function returns an interface to an iterator, a NEW instance of that iterator is created each time the property or method is called.

Properties

IXMLTagIterator
Use this object to iterate through a series of XMLTags. Note that when a property or function returns an interface to an iterator, a NEW instance of that iterator is created each time the property or method is called.

Properties

IXMLIteratorEx
This is a descendant from the IXMLIterator interface, and works exactly the same, but it adds two new methods.

Methods

Insert(IXMLTag): Boolean
Insert the new XMLTag into the list of child nodes _AFTER_ the current "position". The position is based on the .Next and .Prev Calls. Returns true for success, or false if the insert failed.
Remove: boolean
Remove the current element from the element list.

IXMLAttrib
An XMLNode designed just to hold attribute data from attribute pairs like namespace="jabber:iq:roster".

Properties

IXMLField
This is a xml style tag pair.. It Represents something like: <foo>data</foo>. This is used mainly in the IJabberIQ interface, but can also but used in other situations.

Properties

IXMLRepository
The XMLRepository contains a stack of all received XML tags that have come in from a specific stream. This is persistant storage that can be queried after raw xml text has been passed into the repository and XMLTag objects have been created for each complete tag.

Properties

Methods

Tags(index: integer) [IXMLTag]
Returns an interface to a specific tag in the repository. If Index > TagCount than a null pointer is passed back.
Clear
Clear the complete repository of all tags which have been stored. This will also free the memory which was allocated for each XMLTag stored.
Save(filename: string)
Store the complete XML repository out to an XML file. If the filename exists, it will be overwritten automatically.
Load(filename: string)
Load the xml file into this XMLRepository. The entire document will be parsed. It is NOT necessary for the document to have bounding parent tags (ie, it does not have to be a "legal" XML document). It can just be a list of tags. All tags will be completely parsed and will be accessable via the Tags method.
ParseText(input: string) [integer]
This method is called when you want to pass raw text to be parsed into the repository. The return value will be the index value of the first completely parsed tag. If no tags are parsed, the method will return -1. Successive calls the ParseText will add more raw text into the "to-be-parsed" buffer.