Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 18th, 2004, 06:58 AM
Authorized User
 
Join Date: Aug 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.











Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Validating one XML value against another spinout XML 3 August 27th, 2008 01:35 PM
validating xml m_rajib C# 0 May 5th, 2006 12:53 AM
Validating XML sunilyenpure XML 3 July 13th, 2004 12:11 AM
Trouble validating an XML document with a Schema cxs00u XML 0 March 2nd, 2004 12:22 PM
XML, XML Schema, JavaScript, ASP cyberjames2003 XML 0 June 4th, 2003 04:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.