Validating xml schema

Hello

I am new to the System.Xml, I am converting the code existing in MSXML parser code to System.Xml in unmanaged C++.

I am able to load the file with the Load() function, and I am getting the validate error from the catch block. There is no problem in loading the xml documet into the "m_docPtr" this is System.Xml.XmlDocument type.


this->m_docPtr = new XmlDocument();
this->m_xmlTestReader = new XmlTextReader(strFileName);
this->m_xmlValidateReader = new XmlValidatingReader(this->m_xmlTestReader);

// load the strFileName into the document
this->m_docPtr->Load(this->m_xmlValidateReader);

System::String __gc *strParam = new String("//*/Range");

System::Xml::XmlNode *nodePtr = m_docPtr->SelectSingleNode(strParam);

System::String __gc *strVale = new String("-1290");

nodePtr->set_InnerText(strVale);

// Now I want validate the data..
---------
When loading the xml file if the Range is negative , then while loading itself the exception is raised with error message, this is ok for me. Now if I change the value after loading as shown above, then how can I validate after modifying the Range value to -1290. Can anyone please help to do this..

Thanks.
Madhavi.
[1323 byte] By [CCC] at [2007-11-19 2:38:42]