Hello,
I need to create an order xml. Somewhere on the serve i have a base xml file which i would like to load, then change some values and store that xml as private data in the job.
First i tried to load the xml via XMLHttpRequest (which didn't work... obviously ).
Now i have xmlDoc = new Document(baseXmlPath);
but every time switch tries to load the xml is says "Invalid XML Document: C:/path/to/doc.xml" (tried all sort of slashes).
Now the question is how can do this "xmlDoc.getElementsByTagName("orderrefid")[0].childNodes[0].nodeValue = orderrefid;" in Switch?
Thanks in advance
How to load an external xml into script
Re: How to load an external xml into script
Try the inject configurator. You can pick up the file (or a copy of it) and then do metadata pickup.
Free Switch scripts: open-automation @ GitHub
Free Switch apps: open-automation @ Enfocus appstore
Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
Free Switch apps: open-automation @ Enfocus appstore
Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
Re: How to load an external xml into script
In my opinion there are syntax errors in the xml file.Qpdv wrote: but every time switch tries to load the xml is says "Invalid XML Document: C:/path/to/doc.xml" (tried all sort of slashes).
Also check the encoding of the XML file. Is UTF8?