I would like to get all Equipment values. I have used DOM Document. It is reading ONLY LAST Element.
Equipment Id: 28.
I need all three.
Thanks in advanced.
XML File:
<?xml version="1.0" encoding="UTF-8"?>
-<Physical>
<Catalog>
</Catalog>
-<Installed>
-<Equipment>
<Id>26</Id>
<Ref>Tew12</Ref>
-<Characteristic>
<CharacteristicName>Height</CharacteristicName>
<CharacteristicValue>160</CharacteristicValue>
</Characteristic>
-<Characteristic>
<CharacteristicName>Tilt</CharacteristicName>
<CharacteristicValue>30</CharacteristicValue>
</Equipment>
-<Equipment>
<Id>27</Id>
<Ref>Tew13</Ref>
-<Characteristic>
<CharacteristicName>Height</CharacteristicName>
<CharacteristicValue>165</CharacteristicValue>
</Characteristic>
-<Characteristic>
<CharacteristicName>Tilt</CharacteristicName>
<CharacteristicValue>50</CharacteristicValue>
</Equipment>
-<Equipment>
<Id>28</Id>
<Ref>Tew14</Ref>
-<Characteristic>
<CharacteristicName>Height</CharacteristicName>
<CharacteristicValue>190</CharacteristicValue>
</Characteristic>
-<Characteristic>
<CharacteristicName>Tilt</CharacteristicName>
<CharacteristicValue>50</CharacteristicValue>
</Equipment>
</Installed>
</Physical>
Expected Result:
Id 26
Tilt 30
Id 27
Tilt 50
Id 28
Tilt 50
CODE:
http://www.daniweb.com/web-development/php/threads/458094/how-to-get-nodevalue-with-xpathxmlphp