Hi
I'm working on a port from JScript asp to Node.js, and in order to be fully compatible with existing code, i need to use MSXML in order to parse XML. I wrote this piece of code :
var xData = win32ole.client.Dispatch("MSXML2.DOMDocument.6.0");
xData.async = false;
if (!xData.loadXML(xmlResult))
throw Error(xData.parseError.reason);
var nodes = xData.selectNodes("action/data/" + _schema);
node = nodes.nextNode();
while (node != null) {
entries.push({
'objectID': node.attributes.getNamedItem('ba:objectID').text,
'piece': node.selectSingleNode('piece').text,
'credit': parseFloat(node.selectSingleNode('credit').text),
'debit': parseFloat(node.selectSingleNode('debit').text),
'date': node.selectSingleNode('date').text
});
node = nodes.nextNode();
}
But :
- nodes.nextNode() don't seem to work (it iterates infinitely),
- node.attributes.getNamedItem displays :
OLE error: [getNamedItem] -2147352570 [getNamedItem] IDispatch::GetIDsOfNames AutoWrap() failed
- node.selectSingleNode displays
OLE error: [selectSingleNode] Called with NULL IDispatch. AutoWrap() failed
Last both raise exception :
[TypeError: node_win32ole::V8Variant::OLEInvoke failed]
I'm not used at all to node.js (this POC is my first NodeJS experiment), but this works in an IIS environnement on the same machine, so i think the problem is with node/win32ole
Can anyone help please ?
Thanks in advance
Hi
I'm working on a port from JScript asp to Node.js, and in order to be fully compatible with existing code, i need to use MSXML in order to parse XML. I wrote this piece of code :
But :
OLE error: [getNamedItem] -2147352570 [getNamedItem] IDispatch::GetIDsOfNames AutoWrap() failedOLE error: [selectSingleNode] Called with NULL IDispatch. AutoWrap() failedLast both raise exception :
[TypeError: node_win32ole::V8Variant::OLEInvoke failed]I'm not used at all to node.js (this POC is my first NodeJS experiment), but this works in an IIS environnement on the same machine, so i think the problem is with node/win32ole
Can anyone help please ?
Thanks in advance