Skip to main content
17-Peridot
May 2, 2018
Question

Access tag names on namespace XML Document

  • May 2, 2018
  • 2 replies
  • 1201 views

Hi,

I need to access name of each tag on namespace XML document.

sample:

<reading xmlns="http://cyantechnology.com/dean/v1">
<link href="https://cyan-hes-vip-master:8000/v1/readings/0b4ca37b-3600-4c6d-bb9f-320ca6db71de" method="delete" rel="delete"/>
<link href="https://cyan-hes-vip-master:8000/v1/readings/0b4ca37b-3600-4c6d-bb9f-320ca6db71de" method="get" rel="reading"/>
<link href="https://cyan-hes-vip-master:8000/v1/dcus/ade1a127-a301-4d1d-9d6b-2fc697dc2ecb" method="get" rel="dcu"/>
<link href="https://cyan-hes-vip-master:8000/v1/meters/2f8c0a92-7427-4250-af0c-803b2f211fb9" method="get" rel="meter"/>
<meter-serial-number>20004687</meter-serial-number>
<meter-timestamp unit="iso8601">2018-01-16T19:22:39Z</meter-timestamp>
<dcu-timestamp unit="iso8601">2018-01-16T19:22:39Z</dcu-timestamp>
<rtc unit="iso8601">2018-01-17T00:51:34-00:00</rtc>
<configuration_manufacturer>Elster</configuration_manufacturer>
<configuration_model>ELEA16301.01</configuration_model>
<configuration_serial>20004687</configuration_serial>
<configuration_firmware_version>A1630.01.24</configuration_firmware_version>
<configuration_manufacture unit="iso8601">2017</configuration_manufacture>
<relay_missing/>
<tamper>
<tamper_type>ok_tampered_ongoing</tamper_type>
<tamper_state>ongoing</tamper_state>
</tamper>
<billing_3phase>
<billing_3phase_reset>
<billing_3phase_reset unit="iso8601">2017-12-01T00:48:00-00:00</billing_3phase_reset>
<billing_3phase_summary>true</billing_3phase_summary>
<billing_3phase_cumulative_real_energy unit="kWh">167.652750</billing_3phase_cumulative_real_energy>
<billing_3phase_cumulative_apparent_energy unit="kVAh">323.021500</billing_3phase_cumulative_apparent_energy>
<billing_3phase_cumulative_reactive_lag_energy unit="kVArh">273.756250</billing_3phase_cumulative_reactive_lag_energy>
<billing_3phase_cumulative_reactive_lead_energy unit="kVArh">0.076250</billing_3phase_cumulative_reactive_lead_energy>
<billing_3phase_power_factor>0.518</billing_3phase_power_factor>
<billing_3phase_power_laglead>lag</billing_3phase_power_laglead>
</billing_3phase_reset>
</billing_3phase>
<maximum_demand_3phase>...</maximum_demand_3phase>
<load_survey_3phase>...</load_survey_3phase>
<load_survey_apparent_energy_3phase>...</load_survey_apparent_energy_3phase>
<load_survey_reactive_lag_energy_3phase>...</load_survey_reactive_lag_energy_3phase>
<load_survey_reactive_lead_energy_3phase>...</load_survey_reactive_lead_energy_3phase>
<load_survey_average_voltage_L1_3phase>...</load_survey_average_voltage_L1_3phase>
<load_survey_average_voltage_L2_3phase>...</load_survey_average_voltage_L2_3phase>
<load_survey_average_voltage_L3_3phase>...</load_survey_average_voltage_L3_3phase>
<load_survey_average_current_L1_3phase>...</load_survey_average_current_L1_3phase>
<load_survey_average_current_L2_3phase>...</load_survey_average_current_L2_3phase>
<load_survey_average_current_L3_3phase>...</load_survey_average_current_L3_3phase>
<tamper_3phase>...</tamper_3phase>
</reading>

How can i get tag names from this document?

 

Regards,

Sathishkumar C.

2 replies

5-Regular Member
May 3, 2018

Hi @Sathishkumar_C wondering if you have tried the XML parser tool you can access this from the marketplace  Universal Converter Extension it should give you the namespaces out in infotable.

1-Visitor
May 4, 2018

Well actually ThingWorx Server Side Javascript supports Ecma Script for XML -- > E4X, you can work with XML documents out of the box, just look on E4X documentation.