Does anyone use xmltree functions?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello, I am trying to read and translate a substation description from xml file to a matlab file. I have installed a XML parser (<http://www.artefact.tk/software/matlab/xml/>) and my code is almost done, but when I use the function find, it doesn't result index array that I expect.
I show an example of what happens:
example.xml
<?xml version="1.0" ?>
-
- <!-- This is the first entry of our Address Book -->
- <entry lastModified="16-May-2013">
<firstName test="testing" test3="testing3">John</firstName>
<lastName test2="testing2">Doh</lastName>
- <address>
<institute />
<street>1, Avenue des Champs Elysees</street>
<zipCode>75000</zipCode>
<city>Paris</city>
<country>France</country>
</address>
<phone>(+33) 1 23 45 67 89</phone>
<email>john.doh@email.com</email>
</entry>
- <entry lastModified="16-May-2013">
<firstName test="testing" test3="testing3">John</firstName>
<lastName test2="testing2">Doh</lastName>
- <address>
<institute />
<street>1, Avenue des Champs Elysees</street>
<zipCode>75000</zipCode>
<city>Paris</city>
<country>France</country>
</address>
<phone>(+33) 1 23 45 67 89</phone>
<email>john.doh@email.com</email>
</entry>
Ok now I create the tree: tree=xmltree('example.xml')
If I want to know where 'entry' is:
i=find(t,/addressBook/entry') i=[3 22]
Now if I suppose that index is referred to the next line, index 3 is for the fourth line, and there is Entry; index 22 should be for the 23th line then, but there's not entry!
How can I get the right index of each tag that I look for?
thank you
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Data Type Identification dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!