I\'m using XmlReader with an attached XSD for validation.
As my XML document is being read and validated, I want to determine in my C# code the \'maxLength\' value s
you'll find here:Accessing XML Schema Information During Document Validation a good explanation of how to do this & more.
There are ways to do so with myReader.SchemaInfo (see najmeddine's response), but in case you need to access stuff not exposed in the SchemaInfo object...
..XSD being an XML Language. You can simply load the XSD file and using XPath find the "testing" element's definition, and its maxLength.