I'm trying to get a value from a node in a .jdf file. It gives us an error
object required: 'curNode'
in line no. 13 - inputFolder = curNode.getAttribute("Amount")
We don't really know what to do... any help please?
Thank you
'creates the msxml object
Set xmlDoc = CreateObject("Msxml2.DOMDocument.6.0")
Dim xmlDataPath,retVal
xmlDataPath = "C:\Users\liatte\Desktop\Aviv Omer Neta\JDFs to Txt\a.jdf"
'load the xml data of the script
retVal=xmlDoc.load(xmlDataPath)
'get input folder
Set curNode = xmlDoc.selectSingleNode("//JDF/ResourceLinkPool/ComponentLink")
Dim inputFolder
inputFolder = curNode.getAttribute("Amount")
If an XPath expression like
//JDF/ResourceLinkPool/ComponentLinkdoes not select elements in your input document then it is likely that you are processing a document which uses namespaces, see http://en.wikipedia.org/wiki/XML_namespaces.With XPath 1.0 a path like
/foo/barselectsbarchild elements offooelements in no namespace while with an XML document of the formthe elements are in the namespace
http://example.com/ns1.With your sample there is probably a default namespace declaration (e.g.
xmlns="http://www.CIP4.org/JDFSchema_1_1") which requires you to change your XPath expressions by defining a prefix for the namespace e.g.and using it:
Documentation for MSXML is at http://msdn.microsoft.com/en-us/library/windows/desktop/ms756048%28v=vs.85%29.aspx.