Set XML Node value
Status:
Ready
Private Declare Function xdocument_node_value
Lib "xmllab_dll.dll"(ByVal XML_CURSOR As Long,ByVal XML_NODE As String)
As Long
Private Sub xmldom_to_xstorage(ByVal FILENAME As String)Dim DocObject, XMLROOT, XML_DOC_ROOT, XML_CHILD, Res, Retcode As LongEnd Sub
Dim xmldom As MSXML2.DOMDocument
Dim child As MSXML2.IXMLDOMNode
Dim NodeAttribute As MSXML2.IXMLDOMNode
Dim Root As MSXML2.IXMLDOMElement
Dim Name As String, Value As String
Set xmldom = New MSXML2.DOMDocument
xmldom.async = False
xmldom.validateOnParse = False
xmldom.Load (FILENAME)
Set Root = xmldom.documentElement
'create XDocument now
Res = xdocument_create(FILENAME, DocObject)
If Res = 0 Then
'start creating XDocument
XMLROOT = xdocument_root(DocObject)
Name = Root.NodeName
If Root.NodeValue <> Null Then
Value = Root.NodeValue
Else
Value = ""
End If
Retcode = xdocument_add_node(DocObject, XMLROOT, 1, Name, Value, XML_DOC_ROOT)
If Retcode = 0 Then
'create node attributes
For Each NodeAttribute In Root.Attributes
Res = xdocument_add_attr(XML_DOC_ROOT, NodeAttribute.NodeName, NodeAttribute.NodeValue)
Next
For Each child In Root.childNodes
Name = child.NodeName
If child.NodeValue <> Null Then
Value = child.NodeValue
Else
Value = ""
End If
Res = xdocument_add_node(DocObject, XML_DOC_ROOT, 1, Name, Value, XML_CHILD)
If Res = 0 Then
'navigate through childs
Call navigate_tree(DocObject, child, XML_CHILD)
End If
Next
End If
End If
'remove xmldom
Set xmldom = Nothing
Under development
|
Contact Us | | |
|
© 1997-2003 EDMGROUP (Australia) Pty Ltd. All rights reserved. |