hasAttributeNS Function Call

L

Learner

Please , Can anyone help me in finding the problem in this script or
xml document.



var temp11 = xmlDoc.documentElement;

var ns="http://www.tryit.com/fiction";

var elem = temp11.getElementsByTagName('title');

elem=elem.item(0);


if(temp11.hasAttributeNS(ns,'lang') == true)
{
return tr;
}
else
{
tr.info = "hasAttributeNS(namespaceURI,localName) failed";
tr.status = false;
return tr;
}



<?xml version="1.0" encoding="ISO-8859-1" ?>
<bookstore>
<book xmlns:d="http://www.tryit.com/fiction" category="FICTION">
<d:title d:lang="en">The Alchemist</d:title>
<d:author>Paulo Coelho</d:author>
<d:year>2005</d:year>
<d:price>130.00</d:price>
</book>
<book xmlns:c="http://www.tryit.com/children" category="CHILDREN">
<c:title c:lang="en">Harry Potter</c:title>
<c:author>J K. Rowling</c:author>
<c:year>2005</c:year>
<c:price>429.5</c:price>
</book>
</bookstore>


Thanks in Advance

Regards
Ankush
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

getElementsByTagNameNS Function Call 2
Newbie : XPath query question 1
xml xquery and php 2
XML Question 7
XML * XPAth * PHP 0

Members online

Forum statistics

Threads
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top