cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

ThingWorx Navigate is now Windchill Navigate Learn More

Translate the entire conversation x

Create XML

drichter
15-Moonstone

Create XML

Hi,

is there an easy way to create valid xml code? Or is the only way to work with string operations?

ACCEPTED SOLUTION

Accepted Solutions
Chrischhan
13-Aquamarine
(To:drichter)

Thingworx uses the E4X to work with XML: Processing XML with E4X - Archive of obsolete content | MDN

So creating an near empty Object like in Chapter: Creating an XML object


var languages = new XML('<languages type="dynamic"><lang>JavaScript</lang><lang>Python</lang></languages>');

or

var languages = <languages type="dynamic">
   <lang>JavaScript</lang>
   <lang>Python</lang>
</languages>;


And then work with the xml object like you would parse it, but set values to the nodes and attributes

View solution in original post

1 REPLY 1
Chrischhan
13-Aquamarine
(To:drichter)

Thingworx uses the E4X to work with XML: Processing XML with E4X - Archive of obsolete content | MDN

So creating an near empty Object like in Chapter: Creating an XML object


var languages = new XML('<languages type="dynamic"><lang>JavaScript</lang><lang>Python</lang></languages>');

or

var languages = <languages type="dynamic">
   <lang>JavaScript</lang>
   <lang>Python</lang>
</languages>;


And then work with the xml object like you would parse it, but set values to the nodes and attributes

Announcements


Top Tags