Reputation: 180964
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)
Upvotes: 0
Views: 316
Reputation: 78860
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.
Upvotes: 6