This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- XML Node error
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
May 07, 2010
02:56 PM
XML Node error
I'm trying to create an InstallScript function that will parse through a XML file and retrieve the value of an attribute. But whenever I try to create a node, it fails.
There is an exception thrown when
is called. The nodeList has several nodes, I've printed out their names to be sure. But for some reason, it won't create the node object itself!
This is the content of my sample xml file.
Anyone have any idea why the node object fails to create?
set oDoc = CreateObject("Microsoft.XMLDOM");
if(IsObject(oDoc) = FALSE) then
MessageBox("MSXML DOM-Document Connection Failed" , 0);
return -1;
endif;
oDoc.async = FALSE;
oDoc.setProperty("SelectionLanguage", "XPath");
oDoc.load(svFile);
try
set oNodeList = oDoc.getElementsByTagName("*");
catch
MessageBox("Error creating node list", SEVERE);
return -1;
endcatch;
if(oNodeList.length = 0) then
MessageBox("No matching elements found", 0);
return -1;
endif;
for ii = 0 to (oNodeList.length - 1);
try
set oNode = oNodeList.nextNode;
catch
MessageBox("Couldn't assign node", SEVERE);
endcatch;
try
svAttributeValue = oNode.attributes.getNamedItem(svAttribute).value;
catch
svAttributeValue = "";
endcatch;
endfor;
There is an exception thrown when
set oNode = oNodeList.nextNode;
is called. The nodeList has several nodes, I've printed out their names to be sure. But for some reason, it won't create the node object itself!
This is the content of my sample xml file.
Anyone have any idea why the node object fails to create?
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
May 10, 2010
11:25 AM
I'm still having this issue...and I can't seem to figure out what's going wrong. Anyone else had a similar problem?