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 ?
GetElementsByTagName which is not case sensitive?
Asked Answered
Since my other answer was deemed 'not an answer', yet the answer is clearly no, let's try again with a more succinct and to the point post:
can i use a different way in XMLDocument so it wont be case sensitive
No.
Now the questioner can improve his answer count and I won't have to question the sanity of moderators here.
instead of
getElementsByTagName()
Use
selectNodes("//PARAMS | //params")
© 2022 - 2025 — McMap. All rights reserved.
nodeList1=document.getElementsByTagName("PARAMS")
to get a list of<PARAMS ...>
nodes, andnodeList2=document.getElementsByTagName("Params")
to get a list of<Params ...>
nodes. It's unclear why you would be getting an error for either statement. – Hapten