I know that in vbscript we can use documentElement.SelectNodes() to select multiple xml nodes such as in the following example,
<Vocabulary>
<Word type="noun" level="1">
<English>cat</English>
<Spanish>gato</Spanish>
</Word>
<Word type="verb" level="1">
<English>speak</English>
<Spanish>hablar</Spanish>
</Word>
<Word type="adj" level="1">
<English>big</English>
<Spanish>grande</Spanish>
</Word>
</Vocabulary>
Using:
Set NodeList = objXMLDoc.documentElement.selectNodes("Word/English")
But how can the same be done for nodes without a closing tag that instead use a self-closing bracket:
<Vocabulary>
<Word type="adj" level="1">
<English Text="big" />
<Spanish Text="grande" />
</Word>
</Vocabulary>
Basically I need to get an array of nodes like this, and loop through getting the attribute value ‘Text’, for instance.
If I understand correctly , same thing.
Think of the objXMLDoc.documentElement.selectNodes(“Word/English”)(
index) such as your array.An example prints the
Textattributes: