case sensitivity in find() vs children()
I was using jQuery to parse XML (actually a text string returned from
an XMLHttpRequest) and found some odd behaviour when dealing with
elements that weren't all lowercase. Basically find() seems to only
select lowercase elements, regardless of whether the selector string
is lowercase or not, while children() selects elements with no case
sensitivity.
Here's an example that should illustrate the problem:
------
var s = document.createElement("script");
s.setAttribute("type", "text/javascript");
s.addEventListener("load", doParse, true);
s.setAttribute("src", "http://code.jquery.com/jquery-latest.js");
document.getElementsByTagName("head")[0].appendChild(s);
function doParse(){
var n = "<Test><Items><item/><Item/><Item/></Items></Test>";
var $n = $(n);
console.log($n.html());
var items = $("item", $n);
console.log(items); // expected 1, found 1
items = $("Item", $n);
console.log(items); // expected 2, found 1
items = $n.find("Items").children("Item");
console.log(items); // expected 2, found 0
items = $n.children("Items").children("Item");
console.log(items); // expected 2, found 3
}
------