p_mariet
10 years agoOccasional Contributor
Process an XML file with parameters
Hello everyone,
I can't get to pass the second Node (secondNode) because It has a parameter with no value. The error is the following: msxml6.dll Expected value. Do you have any idea how to bypass this?
Function XMLProcess
fileName = "C:\test.xml"
Set doc = Sys.OleObject("Msxml2.DOMDocument.6.0")
Call doc.load(fileName)
value = doc.selectSingleNode("/firstNode[@param=paramValue]/secondNode[@param=]/thirdNode/lastNode/").text
XMLProcess = value
End function
I can't get to pass the second Node (secondNode) because It has a parameter with no value. The error is the following: msxml6.dll Expected value. Do you have any idea how to bypass this?
Function XMLProcess
fileName = "C:\test.xml"
Set doc = Sys.OleObject("Msxml2.DOMDocument.6.0")
Call doc.load(fileName)
value = doc.selectSingleNode("/firstNode[@param=paramValue]/secondNode[@param=]/thirdNode/lastNode/").text
XMLProcess = value
End function
- If the error is "NodeTest expected here", you need to remove the trailing / after lastNode - as in my previous answer.
If this doesn't help, can you post the actual XML file and XPath you're using?