Mixin for nodes.
First the declaration of functions that have no object references.
- Handle
AppendNode(Handle hoNode)
Append Node to the end of list. Returns passed Object handle if Ok, 0 if error
- Integer
hoNewTextNode - Integer
hinfcNode - Integer
infcReturned
- Handle
InsertBeforeNode(Integer hoNewNode Integer hoNode)
Insert NewNode before Node. Returns passed newnode Object handle if Ok, 0 if error
- Integer
hinfcNewNode - Integer
hinfcNode - Integer
iType - Integer
hoRefNode - Integer
infcReturned
- Handle
RemoveNode(Integer hoNode)
Remove Node. Returns object Id of removed node, zero if error
Important: The node is not destroyed! This lets you move it elsewhere if you want
- Integer
hInfcNode
- Handle
ReplaceNode(Integer hoNewNode Integer hoNodeToReplace)
Replace Node. Returns object Id of replaced node, zero if error
Important: The replaced node is not destroyed! This lets you move it elsewhere if you want
- Integer
hInfcNewNode - Integer
hinfcNodetoReplace - Integer
hinfcNode
- Handle
RemoveNamedNode(String sQueryString)
Remove the named node. Returns handle to removed node. You must destroy
or move this removed object as needed
- Integer
hoNode - Integer
hInfcTemplate - Integer
hinfcNode
- Handle
CloneNode(Integer bRecurse)
This function creates a clone of the passed Node. if bRecurse all child nodes are also
cloned. The object Id of the new clone object is returned.
The interface of the object returned can be used in AppendChild to add
the node to the XML Document.
- Integer
hoNewNode - Integer
hinfcNewNode
- Handle
ChildNodes()
Create a collection of all nodes. returns handle of a cXMLDomNodeList
- Integer
infcNodeList - Integer
hoNodeList
- Handle
AttributeNodes()
Create a collection of all attributes. returns handle of a cXMLDomNodeMapList
- Integer
hoCollectionId - Integer
hinfcAttributes
- Handle
TempAttributeNodes()
Create a collection of all attributes for the temporary attribute node object.
Using this saves a small amount of time creating and destroying this object but
it must be used with care. This binding is temporary!
- Integer
hoCollectionId - Integer
hoDocument - Integer
hinfcAttributes
- Handle
ElementNodes(String sQueryString)
Returns a collection of just elements
- Integer
hoNodeList - Integer
hinfcNodeList
- Handle
FindNode(String sQueryString)
Return object handle for query.
- Integer
hoNode - Integer
hinfcNode
- Handle
FindNodeList(String sQueryString)
Return object handle for a collection node.
- Integer
hoNodeList - Integer
hinfcNodeList
- Handle
CreateElementNode(String sTagName String sValue)
The CreatexxxxxNode messages creates an node object for the type specified. Both
the interface and the object or of the correct type (i.e. element, comment)
These all return an object handle which can be used to place the object via
appendNode or InsertBeforeNode
This function creates a child element, returning a dataflex object.
The interface of the object returned can be used in AppendChild to add
the element to the XML Document.
- Integer
hoNewElement - Integer
hoDocumentObject - Integer
infcNewElement - Integer
iClassId
- Handle
CreateAttributeNode(String sName String sValue)
This function creates an attribute in a document. Attributes are _NOT_ children of an element.
A DataFlex object is returned. An attribute can be added to an xml document using
get AddAttributeNode.
- Integer
hoNewAttribute - Integer
hoDocumentObject - Integer
infcNewAttribute - Integer
iClassId
- Handle
CreateChildComment(String sValue)
This function creates a child comment, returning a dataflex object.
The interface of the object returned can be used in AppendChild to add
the comment to the XML Document.
- Integer
hoNewComment - Integer
hoDocumentObject - Integer
infcNewComment - Integer
iClassID
- Handle
CreateChildProcessingInstruction(String sTarget String sValue)
This function creates a child processing instruction, returning a dataflex object.
The interface of the object returned can be used in AppendChild to add
the processing instruction to the XML Document.
- Integer
hoNewProcessingInstruction - Integer
hoDocumentObject - Integer
infcNewProcessingInstruction - Integer
iClassID
- Handle
CreateChildTextNode(String sValue)
This function creates a child text node, returning a dataflex object.
The interface of the object returned can be used in AppendChild to add
the text node to the XML Document.
- Integer
hoNewTextNode - Integer
hoDocumentObject - Integer
infcNewTextNode - Integer
iClassID
- Handle
CreateCDATASectionNode(String sValue)
This function creates a cdata text node, returning a dataflex object.
The interface of the object returned can be used in AppendChild to add
the cdata node to the XML Document.
- Integer
hoNewNode - Integer
hoDocumentObject - Integer
infcNewNode - Integer
iClassId
- Handle
CreateDocumentFragmentNode()
Create a document fragment. Document fragments can be used to house nodes temporarily. When
You append or insert a document fragment (appendNode InsertBeforeNode) child nodes are appended
to the destination object and not the fragment node itself. This is useful!
- Integer
hoNew - Integer
hoDocumentObject - Integer
infcNew - Integer
iClassID
- Handle
CreateChildNode(Integer iNodeType String sTagName String sNameSpace)
Create a Node of any passed Type (e.g. Node_element). Normally you don't need this as there are
specific messages to do this for each node type. Node that this lets you pass namespaces as a separate
parameter. With all of the other messages (e.g. createElementNode) you pass namespaces as prefixed to
the tagname (e.g. Get CreateElementNode "MyNameSpace:MyTag" "MyValue" to hoEle)
- Integer
hoNewNode - Integer
hoDocumentObject - Integer
infcNewNode - Integer
iClassid - Integer
iType
- Handle
AddElement(String sTagName String sValue)
The Addxxxxx messages create a new node and appends it to the list. When used as a function,
the object handle is returned and must be disposed of later by the programmer.
When used as a procedure, the object is destroyed--it just does it and is done.
- Integer
hoNewElement
AddElement(String sTagName String sValue)
- Integer
hoNewElement
- Handle
CreateElementNodeNS(String sNameSpace String sTagName String sValue)
this returns the object, This is often needed
- Integer
hoNewElement
- Handle
AddElementNS(String sNameSpace String sTagName String sValue)
this returns the object, This is often needed
- Integer
hoNewElement
AddElementNS(String sNameSpace String sTagName String sValue)
- Integer
hoNewElement
- Handle
AddAttributeNode(Handle hoNode)
- Integer
hInfc
- Handle
AttributeValueNode(String sName)
// is this needed
Function AddAttributeNodeNS handle hoNode returns Handle
Get AddAttributeNode hoNode to hoNode
function_return hoNode
End_Function
- Integer
hInfc - Integer
hoNode
- Handle
AttributeValueNodeNS(String sNameSpace String sBaseName)
- Integer
hoAttrs - Integer
hoAttr - String
sValue
- Handle
CreateAttributeNodeNS(String sNameSpace String sName String sValue)
- Integer
hoNewAttribute
AddAttributeNS(String sNameSpace String sName String sValue)
- Integer
hoNode
AddAttribute(String sName String sValue)
This function encapsulates creation and addition of attributes to a node.
should only work with element class
AddChildComment(String sValue)
This function encapsulates creation and addition of comments to a node.
The return value is a Boolean that is currently unused.
- Integer
hoNewNode
AddChildProcessingInstruction(String sTarget String sValue)
This function encapsulates creation and addition of processing instructions to a node.
The return value is a Boolean that is currently unused.
- Integer
hoNewNode
AddChildTextNode(String sValue)
This function encapsulates creation and addition of text nodes to a node.
The return value is a Boolean that is currently unused.
- Integer
hoNewNode
AddCDataSection(String sValue)
This procedure encapsulates creation and addition of cdata text nodes to a node.
- Integer
hoNewNode
- Handle
AddChildNode(Integer iNodeType String sTagName String sNameSpace)
- Integer
hoNewNode - Integer
hoDocumentObject
- String
psText()
don't use the runtime/msxml version of this. Instead just return the
first text from the first child node. This is much faster
- Integer
hText - String
sValue
- String
AllChildNodesText()
Use this to call the internal Text property. This returns all text for all child
node. You rarely would want to do this. The is uses the msxml psText which can
get slow with very large files. If for some reason you need all of the child node's
text and the file is large, you might want to consider doing this process manually.
- String
sValue
- String
InfcNodeValue(Handle hInfc)
return the interface NodeValue without having to create a
new object
- Integer
hoDocument - Integer
hoTempNode - String
sValue
- String
ChildNodeValue(String sTagName)
ChildNodeValue is used to get the "value" of an element. This is useful when the element
only has a single value (similar to an attribute).
- Integer
hoTempNode - Integer
hoDocument - Integer
hinfcTempNode - String
sRetVal
SetChildNodeValue(String sTagName String sValue)
This simple function allows a parent to change the text of one of its elements.
This actually occurs quite a bit, because (as stated above) lowest level
elements are frequently used as properties.
- Integer
hoTempNode - Integer
hinfcTempNode
- Handle
FirstChild()
These messages are used to allow you to travese through a nodes.
- Integer
hoChild - Integer
hinfcChild
- Handle
NextSibling()
- Integer
hoChild - Integer
hinfcChild
- Handle
PreviousSibling()
- Integer
hoChild - Integer
hinfcChild
- Handle
LastChild()
- Integer
hoChild - Integer
hinfcChild
- Handle
ParentNode()
return an object that is the parent of the current node
- Integer
hoId - Integer
hinfcXMLInterface
- Handle
NextNode()
Same as NextSibling except it uses or destroys the current node
optimized version does not destroy/create object unless it needs to.
if the next node is the same node type we will resuse this object
else this object is destroyed
- Integer
hoNode - Integer
hoDocument - Integer
hInfc
EnumerateNodes(Integer iMsg Integer hoReceiver String sVal1 String sVal2)
Enumerate through all nodes.
- Integer
i - Integer
iLen - Integer
hoNode - Integer
hoNodeCollection
EnumerateElements(Integer iMsg Integer hoReceiver String sVal1 String sVal2)
Enumerate through all elements.
- Integer
i - Integer
iLen - Integer
hoNode - Integer
hoNodeCollection
EnumerateAttributes(Integer iMsg Integer hoReceiver String sSomeValue)
enumerate through all attributes. There is no recurse here because attributes will not
contain attributes.
- Integer
i - Integer
iLen - Integer
hoNode - Integer
hoNodeMapCollection
- String
XSLTransformation(Integer hoXSLDocument)
- Integer
infcXSLStartAt - String
sBuffer
- Address
XSLTransformationToAddress(Integer hoXSLDocument)
This allows for transformations not limited to the size of the string buffer
Note that it is up to the programmer to dispose of the memory allocated at pBuffer
by using the free(pBuffer) function
- Integer
infcXSLStartAt - Address
pBuffer
- String
BaseNameFromQName(String sName)
extract base name from string. e.g.: ns:name --> name
- Integer
iPos
- String
PrefixNameFromQName(String sName)
extract prefix name from string. e.g.: ns:name --> ns
- String
sPreFix - Integer
iPos
- Boolean
IsElementNS(String sNamespaceURI String sBaseName)
Returns true if node is element and namespace and base name match
- Handle
ChildElementNS(String sNameSpaceURI String sBaseName)
Returns node of first occurence of child node matching namespace and base name
- Integer
hoNode
- Handle
NextElementNS(String sNameSpaceURI String sBaseName)
Returns node of next occurence of sibling node matching namespace and base name
and destroys the current node.
Function NextElementNS String sNameSpaceURI String sBaseName Returns Handle
handle hoNode
Get NextSibling to hoNode
While (hoNode and not(IsElementNS(hoNode, sNameSpaceURI, sBaseName)))
Get NextNode of hoNode to hoNode
end
Send Destroy
function_return hoNode
end_function
- Integer
hoNode
- String
ChildElementValueNS(String sNameSpaceURI String sBaseName)
Returns value (string) first occurence of child node matching namespace and base name
- Integer
hoNext - String
sText
SetChildElementValueNS(String sNameSpaceURI String sBaseName String sValue)
- Integer
hoNode - Integer
hinfcTempNode
- String
PrefixToNamespaceURI(String sPrefix)
// Returns node of first occurence of child node matching namespace and base name
// that has an attrib value that contains a specified value
//
Function FindElementNodeWithAttribNS string sNamespace string sBaseName string sAttribName string sAttribValue returns handle
handle hoNext hoNode
string sName
Get FirstChild to hoNode
While (hoNode)
If (IsElementNS(hoNode, sNameSpace, sBaseName)) begin
Get AttributeValue of hoNode sAttribName to sName
If (sName=sAttribValue) Begin
Function_return hoNode
end
end
Get NextSibling of hoNode to hoNext
Send Destroy of hoNode
Move hoNext to hoNode
end
function_return 0
end_function
pass a prefix and try to finds its NameSpaceURI. Start at current node and work up to parent.
This can be useful when a qualified name is found in an attribute value
- Integer
hoNode - Integer
i - Integer
iNodes - Integer
hoNodes - Integer
hoParentNode - Integer
hoAttNode - Boolean
bDone - Boolean
bParent - String
sAttPrefix - String
sName - String
sNameSpace