OleDll "VBDOM"


 Version: 1.0.0
 

Index:


Document
Element
NodeList
Utilities

Class "Document"


Represents the top level of the XML source. Includes methods and properties used to obtain or create all other XML objects.

Public:


Properties:
 Public Property Get documentElement ( ) As Element
Methods:
 Public Function createElement ( ByVal tagName As String ) As Element
 Public Function load ( ByVal xmlSource As String ) As Boolean
 Public Function nodeFromID ( ByVal idString As String ) As Element
 Public Sub save ( ByVal destination As String )
 Public Function selectNodes ( ByVal queryString As String ) As NodeList
 Public Function selectSingleNode ( ByVal queryString As String ) As Element

Private:


Methods:
 Friend Sub cacheAddElement ( ByVal id As String objElement As Element )
 Friend Function internalGetElement ( ByVal id As String ByVal isNew As Boolean ByVal strTag As String ) As Element

Documentation:


 Friend Sub cacheAddElement ( ByVal id As String objElement As Element )

Internal element cache update routine.

Remarks

Used internally for Element object caching update.



moduleindexbacktop
 Public Function createElement ( ByVal tagName As String ) As Element

Creates an element node using the specified name.

Remarks

None



moduleindexbacktop
 Public Property Get documentElement ( ) As Element

Returns the root element of the document.

Remarks

None



moduleindexbacktop
 Friend Function internalGetElement ( ByVal id As String ByVal isNew As Boolean ByVal strTag As String ) As Element

Internal element allocation, initialization and caching routine.

Remarks

Used internally for Element object caching.



moduleindexbacktop
 Public Function load ( ByVal xmlSource As String ) As Boolean

Loads an XML document from the specified location.

Remarks

None



moduleindexbacktop
 Public Function nodeFromID ( ByVal idString As String ) As Element

Returns the node whose ID attribute matches the supplied value.

Remarks

Only documentElement first level children can be selected.



moduleindexbacktop
 Public Sub save ( ByVal destination As String )

Saves an XML document to the specified location.

Remarks

Not implemented.



moduleindexbacktop
 Public Function selectNodes ( ByVal queryString As String ) As NodeList

Applies the specified pattern-matching operation to this node's context and returns the list of matching nodes.

Remarks

SelectionLanguage and SetProperty properties are not implemented.



moduleindexbacktop
 Public Function selectSingleNode ( ByVal queryString As String ) As Element

Applies the specified pattern to this node's context and returns the first matching node.

Remarks

Not implemented. SelectionLanguage and SetProperty properties are not implemented.



moduleindexbacktop

Class "Element"


Represents the element object.

Public:


Properties:
 Public Property Get ownerDocument ( ) As Document
 Public Property Get parentNode ( ) As Element
 Public Property Get text ( ) As String
 Public Property Let text ( ByVal strNewText As String )
Methods:
 Public Function appendChild ( ByVal newChild As Element ) As Element
 Public Function getAttribute ( ByVal name As String ) As String
 Public Function removeChild ( ByVal childNode As Element ) As Element
 Public Function selectNodes ( ByVal queryString As String ) As NodeList
 Public Function selectSingleNode ( ByVal queryString As String ) As Element
 Public Sub setAttribute ( ByVal name As String ByVal value As String )

Private:


Properties:
 Friend Property Let id ( ByVal strId As String )
 Friend Property Set ownerDocument ( ByRef doc As Document )
Methods:
 Private Sub backup ( ByVal toBackup As Boolean )
 Private Sub deleteElement ( )
 Private Sub insertElement ( )
 Private Sub load ( )
 Friend Sub reload ( )
 Friend Sub restore ( )
 Friend Sub setDefAttribute ( ByVal strAttributeName As String )
 Friend Sub setNew ( ByVal blnIsNew As Boolean )
 Friend Sub setTag ( ByVal strTagName As String )
 Private Sub updateAttribute ( ByVal strName As String )
 Private Sub updateElement ( )

Documentation:


 Public Function appendChild ( ByVal newChild As Element ) As Element

Appends newChild as the last child of this node.

Remarks

Node order is not implemented.



moduleindexbacktop
 Private Sub backup ( ByVal toBackup As Boolean )

Backups and restores the object state.

Remarks

Used for transaction rollback for avoiding database roundtrip.



moduleindexbacktop
 Private Sub deleteElement ( )

Deletes the node from the database.

Remarks

Not used



moduleindexbacktop
 Public Function getAttribute ( ByVal name As String ) As String

Retrieves the value of the named attribute.

Remarks

None



moduleindexbacktop
 Friend Property Let id ( ByVal strId As String )

Sets the id if the element.

Remarks

The id is the primary key of the element in the database. The pair id and tablename identyfy unique the element.



moduleindexbacktop
 Private Sub insertElement ( )

Inserts a new record in the database with the data from attribute values collection.

Remarks

None



moduleindexbacktop
 Private Sub load ( )

Loads the attribute names, values and types from the database.

Remarks

None



moduleindexbacktop
 Public Property Get ownerDocument ( ) As Document

Returns reference to the owner document object.

Remarks

None



moduleindexbacktop
 Friend Property Set ownerDocument ( ByRef doc As Document )

Sets the reference to the owner document object.

Remarks

None



moduleindexbacktop
 Public Property Get parentNode ( ) As Element

Returns the parent node (for nodes that can have parents).

Remarks

None



moduleindexbacktop
 Friend Sub reload ( )

Reloads the data from the database.

Remarks

Used for updating the object data before reading or writing any data to the database in the context of a transaction.



moduleindexbacktop
 Public Function removeChild ( ByVal childNode As Element ) As Element

Removes the specified child node from the list of children and returns it.

Remarks

None



moduleindexbacktop
 Friend Sub restore ( )

Restores the state of the element previously backe up with backup.

Remarks

Used for restoring the state after transaction rollback.



moduleindexbacktop
 Public Function selectNodes ( ByVal queryString As String ) As NodeList

Applies the specified pattern-matching operation to this node's context and returns the list of matching nodes.

Remarks

SelectionLanguage and SetProperty properties are not implemented.



moduleindexbacktop
 Public Function selectSingleNode ( ByVal queryString As String ) As Element

Applies the specified pattern to this node's context and returns the first matching node.

Remarks

SelectionLanguage and SetProperty properties are not implemented.



moduleindexbacktop
 Public Sub setAttribute ( ByVal name As String ByVal value As String )

Sets the value of the named attribute.

Remarks

If an attribute with that name does not exist, it is NOT created.



moduleindexbacktop
 Friend Sub setDefAttribute ( ByVal strAttributeName As String )

Sets the name of the attribute returned as element's text.

Remarks

Used internally for storing the name of the attribute for Attribute nodes emulation.

Also emulates element text (text()). This means that there caan be only one text node.



moduleindexbacktop
 Friend Sub setNew ( ByVal blnIsNew As Boolean )

Sets the object as newly created object.

Remarks

Used internally for flagging elements not appended to a existing node. This flag is used for deciding whether to INSERT or UPDATE.



moduleindexbacktop
 Friend Sub setTag ( ByVal strTagName As String )

Sets the name of the element.

Remarks

Used internally for storing the name of the database table.



moduleindexbacktop
 Public Property Get text ( ) As String

Returns the string representing the text contents of this node.

Remarks

None



moduleindexbacktop
 Public Property Let text ( ByVal strNewText As String )

Sets the text contents of this node.

Remarks

None



moduleindexbacktop
 Private Sub updateAttribute ( ByVal strName As String )

Updates the value of named attribute in the database.

Remarks

If the id attribute is changed then the cache in the document object is updated.



moduleindexbacktop
 Private Sub updateElement ( )

Updates the data in the database with that in the object.

Remarks

None



moduleindexbacktop

Class "NodeList"


The NodeList object supports indexed access to a collection of nodes.

Public:


Properties:
 Public Property Get item ( ByVal index As Long ) As Element
 Public Property Get length ( ) As Long

Private:


Methods:
 Private Sub load ( )
 Friend Sub setOwnerDocument ( ByRef doc As Document )
 Friend Sub setQueryString ( ByVal strQueryString As String )
 Friend Sub setTag ( ByVal strTagName As String )

Documentation:


 Public Property Get item ( ByVal index As Long ) As Element

Returns reference to a node by index.

Remarks

None



moduleindexbacktop
 Public Property Get length ( ) As Long

Returns the number of nodes in the collection.

Remarks

None



moduleindexbacktop
 Private Sub load ( )

Loads the internal collection of with the IDs of the collection elements.

Remarks

None



moduleindexbacktop
 Friend Sub setOwnerDocument ( ByRef doc As Document )

Sets the reference to the owner document object.

Remarks

None



moduleindexbacktop
 Friend Sub setQueryString ( ByVal strQueryString As String )

Sets the SQL query string used for element selection.

Remarks

None



moduleindexbacktop
 Friend Sub setTag ( ByVal strTagName As String )

Sets the name of the elements in the collection.

Remarks

Corresponds to the table name.



moduleindexbacktop

Module "Utilities"


Library of utility functions.

Public:


Methods:
 Public Function formatMessage ( ByVal format As String ParamArray args ( ) ) As String

Private:

Documentation:


 Public Function formatMessage ( ByVal format As String ParamArray args ( ) ) As String

This function formats a message string.

Remarks

None



moduleindexbacktop

Build on Samstag, 27. August 2005 by VBDOX
Copyright © 2000 - 2003 M.Stamenov