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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Getting data from XML tag

rrichardson
5-Regular Member

Getting data from XML tag

So I have an Astra-EX rfid reader with some rfid id tags.  I connect and everything.  I have installed Eclipse and the LLRP commander GUI to run commands to obtain rfid tags detected by the reader.  The command spits out a .llrp file (essentially xml) that has the id of the tag (i.e. the EPC value).  I want to bring this value into ThingWorx.  A copy of the file is attached.  I save this file to the root directory of my TomCat Server so that it can be reached via http. I get an error because of the tag naming convention when trying to create a row in an infotable from the resulting xml file I get when using GetXML snippet.  Does the xml page need to be parsed or something before adding the data to the infotable?  I have saved the attached document as an xml file as I could not attach the file as .llrp

 

Please help.

 

Thanks,

 

 

 

 

2 REPLIES 2
rrichardson
5-Regular Member
(To:rrichardson)

So, I was able to use GetText to pull in the entire XML.  I am not concerned with keeping the XML format as I only need to extract the tagid itself.  This should work! I want to take that value and assign it to a thing property (which I can do). 

 

However, I am interested in knowing why I couldn't extract the value by simply using the GetXML snippet.  Looking at the XML as text, it should have worked (see attached).

Hello,

 

Server Side TW Javascript has ECMAScript (E4X) embedded, you can just work with XML documents out of the box.

 

Best Regards,

Carles

Top Tags