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
rice>130.00</d
rice>
</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
rice>429.5</c
rice>
</book>
</bookstore>
Thanks in Advance
Regards
Ankush
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
</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
</book>
</bookstore>
Thanks in Advance
Regards
Ankush