Everything you do with XML is case sensitive, I know that.
However, right now I find myself in a situation, where the software I’m writing would yield much fewer errors if I somehow made xml name/attribute recognition case insensitive. Case insensitive XPath would be a god sent.
Is there an easy way/library to do that in c#?
An XMl document can have two different elements named respectively:
MyNameandmyName— that are intended to be different. Converting/treating them as the same name is an error that can have gross consequences.In case the above is not the case, then here is a more precise solution, using XSLT to process the document into one that only has lowercase element names and lowercase attribute names:
when this transformation is applied on any XML document, for example this one:
the wanted, correct result (element and attribute names converted to lowercase) is produced:
Once the document is converted to your desired form, then you can perform any desired processing on the converted document.