1
Automation Interface, Add-Ins and Tools / Re: XML elementNode.appendChild(childNode) - JAVASCRIPT
« on: June 16, 2017, 10:37:17 pm »
Hi Geert,
No, it is not the problem.
The problem is now how to manipulate this DOM. There are commands than you can use in both langages (JScript and JavaScript either). For instance :
But the problem begins now if you have to handle your XML DOM :
So, the main problem is how to handle an XML DOM (retrieve a Node, append a Node, read a DOM, ...) inside EA13 with JavaScript as you are able to do with JScript or VBScript.
Best Regards,
Daniel
No, it is not the problem.
- It's easy to instantiate a DOM in JScript inside EA13. For instance : xmlDOM = new ActiveXObject( "MSXML2.DOMDocument.6.0" );
- It's also easy to instantiate a DOM in JavaScript inside EA13. for instance : xmlDOM = new COMObject( "MSXML2.DOMDocument" );
The problem is now how to manipulate this DOM. There are commands than you can use in both langages (JScript and JavaScript either). For instance :
- loadXML() ---------------------> xmlDOM.loadXML(SEARCH_SPECIFICATION);
- createElement() --------------> row = pXmlDOM.createElement("Row");
But the problem begins now if you have to handle your XML DOM :
- parentNode.appendChild(childNode); will operate seamlessly in JScript. That will append an XML childNode to your parentNode.
- parentNode.appendChild(childNode); won't work in JavaScript because this function doesn't exist. And I can't find an equivalent function or how to do it in SpiderMonkey JavaScript 1.8.
So, the main problem is how to handle an XML DOM (retrieve a Node, append a Node, read a DOM, ...) inside EA13 with JavaScript as you are able to do with JScript or VBScript.
Best Regards,
Daniel