+ this._validationErrors.Clear();\r
+\r
+ NameTable nt = new NameTable();\r
+ XmlNamespaceManager nm = new XmlNamespaceManager( nt );\r
+ XmlParserContext pc = new XmlParserContext( null, nm, null, XmlSpace.None );\r
+\r
+ XmlValidatingReader valReader = new XmlValidatingReader( xmlDoc.OuterXml, XmlNodeType.Element, pc );\r
+\r
+ valReader.ValidationType = ValidationType.Schema;\r
+ //XmlSchemaCollection schemaColl = new XmlSchemaCollection();\r
+ //schemaColl.Add( null, this.XsdPathNombre );\r
+ \r
+ valReader.Schemas.Add( "", this.XsdPathNombre ); // schemaColl );\r
+\r
+ valReader.ValidationEventHandler += new ValidationEventHandler(valReader_ValidationEventHandler);\r
+\r
+ //while ( valReader.Read() );\r
+\r
+ while (valReader.Read())\r
+ {\r
+ if (valReader.IsStartElement())\r
+ {\r
+ if (valReader.Prefix==String.Empty)\r
+ Console.WriteLine("<{0}>", valReader.LocalName);\r
+ else\r
+ {\r
+ Console.Write("<{0}:{1}>", valReader.Prefix, valReader.LocalName);\r
+ Console.WriteLine(" The namespace URI is " +\r
+ valReader.NamespaceURI);\r
+ }\r
+ }\r
+ }\r
+\r
+\r
+ valReader.Close();\r
+\r
+ return (this._validationErrors.Count == 0) ;\r