EDN Admin
Well-known member
Simply put, I need to pull out the following data from the below XML:
deviceinfo1
devicestatus: workingflowrate: 25
deviceinfo2
devicestatus: defectiveflow rate: 37
<pre class="prettyprint <testManagementReport xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
<referenceID>Bin02</referenceID>
<reportType>subscription</reportType>
<managementReport>
<objectBasedReport>
<objectID>deviceInfo1</objectID>
<objectBasedReportElement>
<nameValue>
<objectAttribute>devicestatus</objectAttribute>
<attributeValue>working</attributeValue>
</nameValue>
<nameValue>
<objectAttribute>flowrate</objectAttribute>
<attributeValue>25</attributeValue>
</nameValue>
</objectBasedReportElement>
</objectBasedReport>
<objectBasedReport>
<objectID>deviceInfo2</objectID>
<objectBasedReportElement>
<nameValue>
<objectAttribute>devicestatus</objectAttribute>
<attributeValue>defective</attributeValue>
</nameValue>
<nameValue>
<objectAttribute>flowrate</objectAttribute>
<attributeValue>37</attributeValue>
</nameValue>
</objectBasedReportElement>
</objectBasedReport>
</managementReport>
</testManagementReport>[/code]
<br/>
Needs to be dynamic because the number of devices (objectBasedReport tags) can be anywhere from 1 - 200. Any good suggestions or examples to query this?<br/>
View the full article
deviceinfo1
devicestatus: workingflowrate: 25
deviceinfo2
devicestatus: defectiveflow rate: 37
<pre class="prettyprint <testManagementReport xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
<referenceID>Bin02</referenceID>
<reportType>subscription</reportType>
<managementReport>
<objectBasedReport>
<objectID>deviceInfo1</objectID>
<objectBasedReportElement>
<nameValue>
<objectAttribute>devicestatus</objectAttribute>
<attributeValue>working</attributeValue>
</nameValue>
<nameValue>
<objectAttribute>flowrate</objectAttribute>
<attributeValue>25</attributeValue>
</nameValue>
</objectBasedReportElement>
</objectBasedReport>
<objectBasedReport>
<objectID>deviceInfo2</objectID>
<objectBasedReportElement>
<nameValue>
<objectAttribute>devicestatus</objectAttribute>
<attributeValue>defective</attributeValue>
</nameValue>
<nameValue>
<objectAttribute>flowrate</objectAttribute>
<attributeValue>37</attributeValue>
</nameValue>
</objectBasedReportElement>
</objectBasedReport>
</managementReport>
</testManagementReport>[/code]
<br/>
Needs to be dynamic because the number of devices (objectBasedReport tags) can be anywhere from 1 - 200. Any good suggestions or examples to query this?<br/>
View the full article