简体   繁体   中英

XML path - case insensitive

How to convert XML xpath as case insensitive?

XmlNodeList elements = mConfig.SelectNodes(path);

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM