Skip to main content
1-Visitor
Jan 13, 2017 7:58 AM UTC
Question

whether the thingworx support ActiveXObject?

In the program, the  getxml()  can't get an invaild xml,so i get the text with gettext(),then I want to change the text and convert to xml,this process will use ActiveXObject.

when execute the js code , thingworx prompt error.

anyone would help me ?

3 replies

1-Visitor
Jan 13, 2017 8:06 AM UTC

Hi Xiang,

There's no ActiveXObject as this is a Browser object and you are at server side Javascript.

But you are lucky as TW Server Side Javascript supports E4X and you can natively work with XML objects, if you want to instantiate a new Xml, just var a = new XML(youXMLstring);

Translate
向郭_011-VisitorAuthor
1-Visitor
Jan 13, 2017 8:20 AM UTC

thank you coll,

I also want to know how to convert the text into xml ?or how to get rid of the hated " <?xml version="1.0" standalone="yes"?>" in the xml perface?

Translate
1-Visitor
Jan 13, 2017 8:36 AM UTC

Text to XML --> just as said on my previous post:

var aXMLobject = new Object(aXMLstring);

Translate