jQuery - case insensitive tag selector
I've got a XML document looking like this:
<Xmlpp Version="0.3"><meta><Id>123456789</Id></meta></Xmlpp>
开发者_开发知识库And this is how jQuery behaves:
// theDocument is a reference to the XML document
$("meta id", theDocument).size(); // Will return 0
$("meta Id", theDocument).size(); // Will return 1
Is there a way to do a case insensitive search?
Alternatively - write a schema. Make that XML to comply with your schema. I think that it's easier to be consistent rather than code around inconsistancies.
Assuming your xml is exactly as you described, the easiest way should be
$("meta > *", theDocument).size();
精彩评论