Are web.config files always valid XML?
I know that the web.config parser within ASP.net is not a proper XML parser and fails on some valid XML constructs, but I wonder if the reverse is true:
Are (valid) 开发者_开发技巧web.config files always valid XML Files and thus readable by an XML parser?
(I need to manipulate them programatically and would prefer to use XPath, but that requires a valid XML Document)
I've used Linq to XML, XPath, and XmlDocument on config files in the past, and there's never been an XML parsing problem unless the config file itself was bad (and in that case, the application couldn't retrieve configuration settings).
So, in short, yes, they should always be readable by an XML parser.
精彩评论