请问在VB和XML中,能用LoadXML函数吗? 我的strXML这样写对不对?为什么加载后,objDom 仍然是Nothing Dim strXML As String Dim objDom As MSXML.DOMDocument Dim rootNode As IXMLDOMNode strXML = "<?xml version=""1.0 "" encoding=""utf-8"" ?><DbSetting>DbSetting</DbSetting>" Debug.Print strXML Set objDom = New MSXML.DOMDocument '新建一个文档对象 objDom.loadXML (strXML)
If (Len(objDom.xml)) Then rootNode = objDom.documentElement ' sDocumentElement = objDom.documentElement.nodeName ' txtMessages = "The root element is " & sDocumentElement Else MsgBox "There is no root element", vbExclamation, "Show Root Element" End If
我的strXML这样写对不对?为什么加载后,objDom 仍然是Nothing
Dim strXML As String
Dim objDom As MSXML.DOMDocument
Dim rootNode As IXMLDOMNode
strXML = "<?xml version=""1.0 "" encoding=""utf-8"" ?><DbSetting>DbSetting</DbSetting>"
Debug.Print strXML
Set objDom = New MSXML.DOMDocument '新建一个文档对象
objDom.loadXML (strXML)
If (Len(objDom.xml)) Then
rootNode = objDom.documentElement
' sDocumentElement = objDom.documentElement.nodeName
' txtMessages = "The root element is " & sDocumentElement
Else
MsgBox "There is no root element", vbExclamation, "Show Root Element"
End If
总是说找不到CDomFunctions这个库,该怎么处理?