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.
- id - Specifies the ID of the element.
- objElement - Specifies reference to element to update. If
this is Nothing the element is removed form the cache.
RemarksUsed internally for Element object caching update.
module| index| back| top
Public Function createElement ( ByVal tagName As String ) As Element
Creates an element node using the specified name.
- tagName - Name for the new element node. It is case
sensitive. This name is subsequently available as the element node's nodeName
property.
- Returns Element - References to the new element or Nothing on failure.
RemarksNone
module| index| back| top
Public Property Get documentElement ( ) As Element
Returns the root element of the document.
- Returns Element - DOMElement object that represents the single element representing
the root of the XML document tree. Returns Nothing if no root exists.
RemarksNone
module| index| back| top
Friend Function internalGetElement ( ByVal id As String, ByVal isNew As Boolean, ByVal strTag As String ) As Element
Internal element allocation, initialization and caching routine.
- id - Specifies the ID of the element.
- isNew - Specifies whether the element is new one.
- strTag - Specifies the name of the element.
- Returns Element - Element with specified ID.
RemarksUsed internally for Element object caching.
module| index| back| top
Public Function load ( ByVal xmlSource As String ) As Boolean
Loads an XML document from the specified location.
- xmlSource - Indicator of the object that specifies
the source for the XML document.
- Returns Boolean - True if the load succeeded; False if the load failed.
RemarksNone
module| index| back| top
Public Function nodeFromID ( ByVal idString As String ) As Element
Returns the node whose ID attribute matches the supplied value.
- idString - Value of the ID to match.
- Returns Element - Node that matches the supplied ID. If no nodes match, this method
returns Nothing.
RemarksOnly documentElement first level children can be selected.
module| index| back| top
Public Sub save ( ByVal destination As String )
Saves an XML document to the specified location.
- destination - Specifies the file name. Note that this must
be a file name rather than a URL. The file is created if necessary and the
contents are entirely replaced with the contents of the saved document.
RemarksNot implemented.
module| index| back| top
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.
- queryString - XSL or XPath expression that is to be applied
to the context defined by this node. Whether an XSL or XPath query is used is
determined by the value of the SelectionLanguage property. By default,
the expression is an XSL pattern query. The SelectionLanguage property can be
set with the SetProperty method.
- Returns NodeList - List of nodes selected by the XSL or XPath query. If no nodes
are selected by the query, an empty node list is returned.
RemarksSelectionLanguage and SetProperty properties are not implemented.
module| index| back| top
Public Function selectSingleNode ( ByVal queryString As String ) As Element
Applies the specified pattern to this node's context and returns
the first matching node.
- queryString - String specifying the XSL or XPath query that
is to be applied to the context defined by this node. Whether an XSL or XPath
query is used is determined by the value of the SelectionLanguage property.
By default, the expression is an XSL pattern query. The SelectionLanguage
property can be set with the SetProperty method.
- Returns Element - First node that is selected by the XPath query. If no nodes result
from the query, it returns Nothing.
RemarksNot implemented.
SelectionLanguage and SetProperty properties are not implemented.
module| index| back| top
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.
- newChild - Reference to the new child node to be appended
to the end of the list of children of this node.
- Returns Element - New child node successfully appended to the list. If Nothing,
no object is created.
RemarksNode order is not implemented.
module| index| back| top
Private Sub backup ( ByVal toBackup As Boolean )
Backups and restores the object state.
- toBackup - If True the current object data is stored in
a static variables. If False, it is restored from the static storage.
RemarksUsed for transaction rollback for avoiding database roundtrip.
module| index| back| top
Private Sub deleteElement ( )
Deletes the node from the database.
RemarksNot used
module| index| back| top
Public Function getAttribute ( ByVal name As String ) As String
Retrieves the value of the named attribute.
- name - Name of the attribute to return.
- Returns String - String that contains the attribute value. The empty string is
returned if the named attribute does not have a specified or default value.
RemarksNone
module| index| back| top
Friend Property Let id ( ByVal strId As String )
Sets the id if the element.
- strId - Specifies the id of the element.
RemarksThe id is the primary key of the element in the database. The pair
id and tablename identyfy unique the element.
module| index| back| top
Private Sub insertElement ( )
Inserts a new record in the database with the data from attribute
values collection.
RemarksNone
module| index| back| top
Private Sub load ( )
Loads the attribute names, values and types from the database.
RemarksNone
module| index| back| top
Public Property Get ownerDocument ( ) As Document
Returns reference to the owner document object.
- Returns Document - Reference to the document object.
RemarksNone
module| index| back| top
Friend Property Set ownerDocument ( ByRef doc As Document )
Sets the reference to the owner document object.
- doc - Specifies reference to the document object.
RemarksNone
module| index| back| top
Public Property Get parentNode ( ) As Element
Returns the parent node (for nodes that can have parents).
- Returns Element - Parent of the given node instance. However, if a node has just
been created and not yet added to the tree, or if it has been removed from
the tree, the parent is Nothing.
RemarksNone
module| index| back| top
Friend Sub reload ( )
Reloads the data from the database.
RemarksUsed for updating the object data before reading or writing any data
to the database in the context of a transaction.
module| index| back| top
Public Function removeChild ( ByVal childNode As Element ) As Element
Removes the specified child node from the list of children and
returns it.
- childNode - Child node to be removed from the list of
children of this node.
- Returns Element - Removed child node. If Nothing, no object is removed.
RemarksNone
module| index| back| top
Friend Sub restore ( )
Restores the state of the element previously backe up with backup.
RemarksUsed for restoring the state after transaction rollback.
module| index| back| top
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.
- queryString - XSL or XPath expression that is to be applied
to the context defined by this node. Whether an XSL or XPath query is used is
determined by the value of the SelectionLanguage property. By default,
the expression is an XSL pattern query. The SelectionLanguage property can be
set with the SetProperty method.
- Returns NodeList - List of nodes selected by the XSL or XPath query. If no nodes
are selected by the query, an empty node list is returned.
RemarksSelectionLanguage and SetProperty properties are not implemented.
module| index| back| top
Public Function selectSingleNode ( ByVal queryString As String ) As Element
Applies the specified pattern to this node's context and returns
the first matching node.
- queryString - String specifying the XSL or XPath query that
is to be applied to the context defined by this node. Whether an XSL or XPath
query is used is determined by the value of the SelectionLanguage property.
By default, the expression is an XSL pattern query. The SelectionLanguage
property can be set with the SetProperty method.
- Returns Element - First node that is selected by the XPath query. If no nodes result
from the query, it returns Nothing.
RemarksSelectionLanguage and SetProperty properties are not implemented.
module| index| back| top
Public Sub setAttribute ( ByVal name As String, ByVal value As String )
Sets the value of the named attribute.
- name - Name of the attribute to return.
- value - Name of the attribute. If an attribute with that
name already exists, its value is changed.
RemarksIf an attribute with that name does not exist, it is NOT created.
module| index| back| top
Friend Sub setDefAttribute ( ByVal strAttributeName As String )
Sets the name of the attribute returned as element's text.
- strAttributeName - Specifies the name of the attribute
returned as default.
RemarksUsed 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.
module| index| back| top
Friend Sub setNew ( ByVal blnIsNew As Boolean )
Sets the object as newly created object.
- blnIsNew - Specifies whether the object is new one.
RemarksUsed internally for flagging elements not appended to a existing
node. This flag is used for deciding whether to INSERT or UPDATE.
module| index| back| top
Friend Sub setTag ( ByVal strTagName As String )
Sets the name of the element.
- strTagName - Specifies the name of the element.
RemarksUsed internally for storing the name of the database table.
module| index| back| top
Public Property Get text ( ) As String
Returns the string representing the text contents of this node.
- Returns String - The text representation of the contents of the node.
RemarksNone
module| index| back| top
Public Property Let text ( ByVal strNewText As String )
Sets the text contents of this node.
- strNewText - String representing the text content of this node.
This value varies depending on the value of the nodeType.
RemarksNone
module| index| back| top
Private Sub updateAttribute ( ByVal strName As String )
Updates the value of named attribute in the database.
- strName - Name of attribute to update.
RemarksIf the id attribute is changed then the cache in the document object
is updated.
module| index| back| top
Private Sub updateElement ( )
Updates the data in the database with that in the object.
RemarksNone
module| index| back| top
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.
- index - Specifies the index of the node to return.
- Returns Element - Reference to the element of the collection with index index.
RemarksNone
module| index| back| top
Public Property Get length ( ) As Long
Returns the number of nodes in the collection.
- Returns Long - The number of nodes in the collection
RemarksNone
module| index| back| top
Private Sub load ( )
Loads the internal collection of with the IDs of the collection
elements.
RemarksNone
module| index| back| top
Friend Sub setOwnerDocument ( ByRef doc As Document )
Sets the reference to the owner document object.
- doc - Specifies reference to the document object.
RemarksNone
module| index| back| top
Friend Sub setQueryString ( ByVal strQueryString As String )
Sets the SQL query string used for element selection.
- strQueryString - Specifies the SQL query string used for
selecting colection elements.
RemarksNone
module| index| back| top
Friend Sub setTag ( ByVal strTagName As String )
Sets the name of the elements in the collection.
- strTagName - Specifies the name of the elements in
the collection.
RemarksCorresponds to the table name.
module| index| back| top
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.
- format - Specifies the message definition.
- args - Specifies an array of values that are used as insert
values in the formatted message. A %1 in the format string indicates
the first value in the Arguments array; a %2 indicates the second argument;
and so on.
- Returns String - Formatted message.
RemarksNone
module| index| back| top
Build on Samstag, 27. August 2005 by VBDOX
Copyright © 2000 - 2003 M.Stamenov