2

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?

2 Answers 2

5

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.

Sign up to request clarification or add additional context in comments.

1 Comment

+1: Case matters in XML. It makes as much sense to say "I want to match'meta id' and 'meta Id' and nothing else", than it does to say "I want to match 'meta id' and 'meta spoon'", because in both cases you're matching completely different elements.
3

Assuming your xml is exactly as you described, the easiest way should be

$("meta > *", theDocument).size(); 

1 Comment

I guess it works for this case, but it's not a very elegant solution. :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.