Basic XML question...how to hand-create xml for javascript p

wxdqz

New Member
OK, I've worked with program generated XML (such as a PHP script returning xml from an AJAX call)...but I've never figured out how to just write some XML in a text processor and have javascript read it. For example, when I try to count the "criteria" tags from the following xml, by doing a xmldoc.getElementsByTagName("criteria").length call, I get 0. (The script I use to pull the xml and then count tags works on other XML I've pulled from other applications).


<?xml version="1.0" encoding="UTF-8"?>
<root>
<att>
<criteria sqlval="cat" />
<criteria sqlval="dog" />
</att>
<att>
<criteria sqlval="apple" />
<criteria sqlval="orange" />
<criteria sqlval="pear" />
</att>
</root>



What other basic step do I need to take?
 
Back
Top