views:

46

answers:

2

i'm using GetElementsByTagName to extract an element from an xml. GetElementsByTagName is case sensitive - it throws an exception if the node name is 'PARAMS' instead of 'Params'. i dont want that , can i use a different way in XMLDocument so it wont be case sensitive ?

A: 

I'm pretty sure the DOM specifies case-sensitivity - although I know some libraries (eg. one of PHPs) don't always behave this way. XML itself is always case-sensitive. Knowing which language you are using would be helpful.

More background information would be helpful. What is the problem you are actually looking to solve? See http://www.catb.org/~esr/faqs/smart-questions.html#goal

Rushyo
thakn you,I'm writing in C#. I'm receiving the XML by a WCF service. when i get the XML i dont want the code to fail just because one of the XML nodes is 'name' instead of 'Name' or even 'NAME', when i analyze it using GetElementsByTagName.
Rodniko
But why? Since XML is case-sensitive, nobody should ever give you a document with those characteristics. It's a malformed document if they do - and you should probably just handle the exception and tell them off!
Rushyo
A: 

thakn you,

I'm writing in C#. I'm receiving the XML by a WCF service. when i get the XML i dont want the code to fail just because one of the XML nodes is 'name' instead of 'Name' or even 'NAME', when i analyze it using GetElementsByTagName.

Rodniko