hi all,
i'm making an IE application using xml for the data source and javascript to interact with the xml and display it. i'm using the following type of code to extract nodes from the document...
once i have this, i'm familiar with two methods for retrieving data from the individual nodes. for returning attributes of an element i use...
for retrieving the text in an element, i use...
the problem is, the latter one is only usable to me if there are no child elements, as it returns the text for all child elements also if any are present, and i only want to get the text for the given element. does anyone know of a method i can use for getting only the text of an element, even if it has child elements?
thanks,
glenn
i'm making an IE application using xml for the data source and javascript to interact with the xml and display it. i'm using the following type of code to extract nodes from the document...
Code:
var xmlNodes = xmlTag.XMLDocument.selectNodes("e1/e2");
once i have this, i'm familiar with two methods for retrieving data from the individual nodes. for returning attributes of an element i use...
Code:
xmlNodes[i].getAttribute("attribute");
for retrieving the text in an element, i use...
Code:
xmlNodes[i].text;
the problem is, the latter one is only usable to me if there are no child elements, as it returns the text for all child elements also if any are present, and i only want to get the text for the given element. does anyone know of a method i can use for getting only the text of an element, even if it has child elements?
thanks,
glenn