tags:

views:

281

answers:

2

How to convert XML xpath as case insensitive?

XmlNodeList elements = mConfig.SelectNodes(path);

path can be - Config/Setting/Name or config/setting/name

+5  A: 

Hope this article helps

Case-insensitive XPath in .NET

rahul
That article refers to Case-insensitve comparison of __values__ in the xml not the case insensitive comparison of xml node names.
AnthonyWJones
+2  A: 

XML is case sensitive, hence a node with then name Config is does have the same name as the node config. Hence XPath must also respect this.

If you feel you need to use case-insensitive XPaths such as this then you really need to go back to the source of the XML and ask, "why is this generating XML where two nodes have the same meaning same yet differ casing"? Then fix that.

AnthonyWJones