M
mr_burns
Hi,
I have the following code that works fine except the getAttribute line:
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("note.xml");
nodes = xmlDoc.documentElement.childNodes;
text = '<p>note:<br>';
for (var i=0; i<nodes.length; i++) {
title = nodes.item(i).firstChild.text;
value = nodes.item(i).firstChild.getAttribute('id');
text+= title+':'+value;
}
text+= '</p>';
an example of the xml nodes are:
<?xml...
<all>
<node id="1">text</node>
<node id="2">text</node>
<node id="3">text</node>
I have the following code that works fine except the getAttribute line:
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("note.xml");
nodes = xmlDoc.documentElement.childNodes;
text = '<p>note:<br>';
for (var i=0; i<nodes.length; i++) {
title = nodes.item(i).firstChild.text;
value = nodes.item(i).firstChild.getAttribute('id');
text+= title+':'+value;
}
text+= '</p>';
an example of the xml nodes are:
<?xml...
<all>
<node id="1">text</node>
<node id="2">text</node>
<node id="3">text</node>