0

How to Parse XML ?

If we have this XML file and want to Parse Name, position and type. <?xml version="1.0" encoding="UTF-8"?> <devices> <nvx> <device Device="X-360" IP="192.168.1.101" MAddr="239.8.0.0" Name="Apple TV" position="1" type="transmitter"/> <device Device="X-360" IP="192.168.1.102" MAddr="239.8.0.8" Name="Roku Player" position="2" type="transmitter"/> <device Device="X-360" IP="192.168.1.103" MAddr="239.8.0.16" Name="PlayStation" position="3" type="transmitter"/> <device Device="X-360" IP="192.168.1.104" MAddr="239.8.0.32" Name="Cable Box" position="4" type="transmitter"/> <device Device="X-360" IP="192.168.1.151" MAddr="0" Name="Living Room TV" position="1" type="receiver"/> <device Device="X-360" IP="192.168.1.152" MAddr="0" Name="Bedroom TV" position="2" type="receiver"/> <device Device="X-360" IP="192.168.1.153" MAddr="0" Name="Kitchen TV" position="3" type="receiver"/> <device Device="X-360" IP="192.168.1.154" MAddr="0" Name="Garage TV" position="4" type="receiver"/> </nvx> </devices>

28th Dec 2021, 8:50 PM
Ben Cinar
2 ответов
28th Dec 2021, 9:10 PM
SoloProg
SoloProg - avatar
+ 1
Here you can see how to parse xml: https://code.sololearn.com/WKzTAH2PqetR/?ref=app
28th Dec 2021, 9:10 PM
JaScript
JaScript - avatar