Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hi,
is there any way to access tags with variable?
My Sample file is "xmlDocument":
<reading xmlns="http://cyantechnology.com/dean/v1"> <link href="https://cyan-hes-vip-master:8000/v1/readings/824cde15-f6b6-4819-abbe-8524d16f2972" method="delete" rel="delete"/> <link href="https://cyan-hes-vip-master:8000/v1/readings/824cde15-f6b6-4819-abbe-8524d16f2972" method="get" rel="reading"/> <link href="https://cyan-hes-vip-master:8000/v1/dcus/969c515f-cf50-4861-8029-3070e891937b" method="get" rel="dcu"/> <link href="https://cyan-hes-vip-master:8000/v1/meters/91b69412-f06d-45e4-83a3-6fce6694c3bb" method="get" rel="meter"/> <meter-serial-number>17254120</meter-serial-number> <meter-timestamp unit="iso8601">2018-01-23T20:26:15Z</meter-timestamp> <dcu-timestamp unit="iso8601">2018-01-23T20:26:15Z</dcu-timestamp> <rtc unit="iso8601">2018-01-24T01:53:54-00:00</rtc> <configuration_manufacturer>Larsen & Toubro Limited</configuration_manufacturer> <configuration_serial>S17254120</configuration_serial> <configuration_firmware_version>7PB0L.60</configuration_firmware_version> <reading/>
if i want to read "configuration_manufacturer" data. i ll use below one.
result = xmlDocument.*::configuration_manufacturer
Like this how can i read "meter-timestamp" data?
Is anyway to access with variable?
var tag = "meter-timestamp"; result = xmlDocument.*::tag
Regards,
Sathishkumar C.
Solved! Go to Solution.
It is fine.
i replaced "dcu-timestamp".