|
-
Aug 20th, 2008, 06:54 AM
#1
Thread Starter
Member
[RESOLVED] Object variable not set error while loading xml in domdocument
Dim strRelsAttrXML As String
Dim xdcAttrDoc As New MSXML2.DOMDocument
strRelsAttrXML = "<SText>bit.test_report_&_msg_in</SText>"
xdcAttrDoc.loadXML (strRelsAttrXML)
x = xdcAttrDoc.childNodes(0).Text
MsgBox x
Hi
Above code is not working as there is & in node text .
Help neeed. Urgent...
Thanks in advance
-
Aug 20th, 2008, 11:14 AM
#2
Re: Object variable not set error while loading xml in domdocument
It doesn't matter where you post it, the problem comes back to strRelsAttrXML containing an unescaped ampersand and therefore it is not valid XML.
-
Aug 20th, 2008, 07:49 PM
#3
Re: Object variable not set error while loading xml in domdocument
Enclose it in CDATA
"<SText>![CDATA[bit.test_report_&_msg_in]]</SText>"
-
Aug 22nd, 2008, 12:54 AM
#4
Thread Starter
Member
Re: Object variable not set error while loading xml in domdocument
solved the problem by repalcing & in the node text with amp;
-
Aug 22nd, 2008, 01:05 AM
#5
Re: Object variable not set error while loading xml in domdocument
Now that we've helped you, you can help us by pulling down the Thread Tools menu and clicking the Mark Thread Resolved button which will let everyone know that you have your answer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|