Class: cXMLDOMNodeMixin
Mixin for nodes.
First the declaration of functions that have no object references.
Class Hierarchy:
cObjectMixincXMLDOMNodeMixinMixins:
cXMLDOMMixin,
Class Definition
Functions and Procedures
AddAttribute(String sName String sValue)
This function encapsulates creation and addition of attributes to a node.
should only work with element class
HandleAddAttributeNode(Handle hoNode)
AddAttributeNS(String sNameSpace String sName String sValue)
AddCDataSection(String sValue)
This procedure encapsulates creation and addition of cdata text nodes to a node.
AddChildComment(String sValue)
This function encapsulates creation and addition of comments to a node.
The return value is a Boolean that is currently unused.
HandleAddChildNode(Integer iNodeType String sTagName String sNameSpace)
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.
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.
HandleAddElement(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.
AddElement(String sTagName String sValue)
HandleAddElementNS(String sNameSpace String sTagName String sValue)
this returns the object, This is often needed
AddElementNS(String sNameSpace String sTagName String sValue)
StringAllChildNodesText()
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.
HandleAppendNode(Handle hoNode)
Append Node to the end of list. Returns passed Object handle if Ok, 0 if error
HandleAttributeNodes()
Create a collection of all attributes. returns handle of a cXMLDomNodeMapList
HandleAttributeValueNode(String sName)
// is this needed
Function AddAttributeNodeNS handle hoNode returns Handle
Get AddAttributeNode hoNode to hoNode
function_return hoNode
End_Function
HandleAttributeValueNodeNS(String sNameSpace String sBaseName)
StringBaseNameFromQName(String sName)
extract base name from string. e.g.: ns:name --> name
HandleChildElementNS(String sNameSpaceURI String sBaseName)
Returns node of first occurence of child node matching namespace and base name
StringChildElementValueNS(String sNameSpaceURI String sBaseName)
Returns value (string) first occurence of child node matching namespace and base name
HandleChildNodes()
Create a collection of all nodes. returns handle of a cXMLDomNodeList
StringChildNodeValue(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).
HandleCloneNode(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.
HandleCreateAttributeNode(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.
HandleCreateAttributeNodeNS(String sNameSpace String sName String sValue)
HandleCreateCDATASectionNode(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.
HandleCreateChildComment(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.
HandleCreateChildNode(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)
HandleCreateChildProcessingInstruction(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.
HandleCreateChildTextNode(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.
HandleCreateDocumentFragmentNode()
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!
HandleCreateElementNode(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.
HandleCreateElementNodeNS(String sNameSpace String sTagName String sValue)
this returns the object, This is often needed
HandleElementNodes(String sQueryString)
Returns a collection of just elements
EnumerateAttributes(Integer iMsg Integer hoReceiver String sSomeValue)
enumerate through all attributes. There is no recurse here because attributes will not
contain attributes.
EnumerateElements(Integer iMsg Integer hoReceiver String sVal1 String sVal2)
Enumerate through all elements.
EnumerateNodes(Integer iMsg Integer hoReceiver String sVal1 String sVal2)
Enumerate through all nodes.
HandleFindNode(String sQueryString)
Return object handle for query.
HandleFindNodeList(String sQueryString)
Return object handle for a collection node.
HandleFirstChild()
These messages are used to allow you to travese through a nodes.
StringInfcNodeValue(Handle hInfc)
return the interface NodeValue without having to create a
new object
HandleInsertBeforeNode(Integer hoNewNode Integer hoNode)
Insert NewNode before Node. Returns passed newnode Object handle if Ok, 0 if error
BooleanIsElementNS(String sNamespaceURI String sBaseName)
Returns true if node is element and namespace and base name match
HandleLastChild()
HandleNextElementNS(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
HandleNextNode()
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
HandleNextSibling()
HandleParentNode()
return an object that is the parent of the current node
StringPrefixNameFromQName(String sName)
extract prefix name from string. e.g.: ns:name --> ns
StringPrefixToNamespaceURI(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
HandlePreviousSibling()
StringpsText()
don't use the runtime/msxml version of this. Instead just return the
first text from the first child node. This is much faster
HandleRemoveNamedNode(String sQueryString)
Remove the named node. Returns handle to removed node. You must destroy
or move this removed object as needed
HandleRemoveNode(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
HandleReplaceNode(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
SetChildElementValueNS(String sNameSpaceURI String sBaseName String sValue)
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.
HandleTempAttributeNodes()
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!
StringXSLTransformation(Integer hoXSLDocument)
AddressXSLTransformationToAddress(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