Skip to main content
1-Visitor
March 9, 2018
Question

Getting data from XML tag

  • March 9, 2018
  • 2 replies
  • 3445 views

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

1-Visitor
March 9, 2018

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).

1-Visitor
March 10, 2018

Hello,

 

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

 

Best Regards,

Carles