Handling namespaces in JavaScript XML constructor

jeudi 5 mars 2015

I have some javascript code in a channel scoped code template function that was running in Mirth 2.3 where I create an XMl object from a String containing XML.



e.g., var resultXml = new XML(responseMap.get('Call DIS').getMessage());



I'm converting to Mirth 3.2. Now, I'm getting an error because it's encountering some elements with a namespace prefix:



LINE NUMBER: 198

DETAILS: TypeError: The prefix "S" for element "S:Envelope" is not bound.



I've spent a few hours now fruitlessly looking for the correct way to declare the namespace.



I tried preceding this with:

var soap = new Namespace("S","http://ift.tt/z6MlKK;);

default xml namespace=soap;



and also...



XML.addNamespace(soap);

XML.setNamespace(soap);



What is the correct way to do this?





Handling namespaces in JavaScript XML constructor

0 commentaires:

Enregistrer un commentaire