-------------
>>I want to extract values corresponding to different keys in the file.
[...]
But I want to learn the XML DOM functions and thought that someone might suggest a way to do it using XMLAdapter or some other DOM-specific functions.
------------
Do you want a collection of any nodes that have key attributes?
The syntax for that is:
oy= ox.selectNodes("//*[@key]")
? oy.length
Caveat: you can do it more efficiently if you know more about the structure of your document.
Or do you want to get just the valueof the node whose key matches a given value?
The syntax for that is:
oz = ox.selectSingleNode("//*[@key='key2']/@value").text
? oz
>L<
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement