Skip to main content
1-Visitor
April 13, 2017
Solved

Using XML Objects

  • April 13, 2017
  • 1 reply
  • 3642 views

I am working on a project that requires we manage XML Files. I noticed that ThingWorx provides an type that can be used for parameters. When using this I found that the creating a new XML object using the XML string will throw an exception if the XML includes the standard header:

<?xml version="1.0" encoding="UTF-8"?>

<?xml-stylesheet type="text/xsl" href=""?>

Removing the header I find that the XML object is created without an exception. The problem is that I can't seem to find any standard functions that can be used to parse the XML or traverse it's nodes.

Does the XML object when used in a service defined with JavaScript have any functions for accessing nodes and attributes?

Best answer by PaiChung

Thingworx includes an E4X library

are you saying that you can't use the regular node type reference to parse the object?

1 reply

PaiChung22-Sapphire IAnswer
22-Sapphire I
April 13, 2017

Thingworx includes an E4X library

are you saying that you can't use the regular node type reference to parse the object?

5-Regular Member
December 20, 2017

Hi Pai Chung​,

I tried to use E4X but it doesn't reognize some terms. It gives to me sintax error. Do I have to make an import of the library in my code? I am trying to working with an xml soap and it's giving me some trouble. If you wanna mail me to see my code and help me in my problem will be great.

Thank you,

Vinícius Xavier.

22-Sapphire I
December 20, 2017

I would do a search for SOAP there are a lot of examples.

Also SOAP features a lot of namespaces that can be escaped ... couldn't find my original article or post so :

trouble parsing XML