How Can I read the below file without using tag names.If suppose I have to fetch Title value, I know using xmlDoc.getElementsByTagName("title").item(0).firstChild.nodeValue;

But How can I read without using Tag Names.

<title>Airbus Aircraft Families</title>
<Aircraft>A380 </Aircraft>
<Range>15000km </Range>

Recommended Answers

All 3 Replies

IF title will always be the first child of catalog, then simply use:


if it is likely to change position, then you will need to "search" for it:

var i=-1, limit=xmlDoc.documentElement.childNodes.length;

Thanks for replying,I am using the second option, but it says :

xmlDoc.documentElement.childNodes.firstChild is null

Can yoy tell what is the problem?

Did you try:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.