Using xmlreader to validate an xml is always case senstive, is it possible to have a case insensetive validation? i.e. if the element name in the schema is 'FirstName', the xml with name 'Firstname' should be validated.
Asked
Active
Viewed 783 times
0
-
XML is case sensitive by design. As [this link](http://stackoverflow.com/questions/9334771/case-insensitive-xml-parser-in-c-sharp) describes, you could run an XSLT to transform the element case as needed before validating. – Mark M May 22 '12 at 16:45
2 Answers
1
Xml is case sensitive language, so it will not be truly XML validation...
The easiest would be to read all text as text, convert to upper case and than load resulting string as XML.
Another option is to implement your own TextReader-based class (wrapping basic TextReader) and upper-case all letters. Would work much better for large XML documents.

Alexei Levenkov
- 98,904
- 14
- 127
- 179
0
As you may have noticed, XML is case sensitive. So one way to make the validation case insensitive would be to make the schema case insensitive. In the schema, instead of FirstName, try using a pattern with the following: [Ff][Ii][Rr][Ss][Tt][Nn][Aa][Mm][Ee].

seekerOfKnowledge
- 524
- 5
- 25