473,386 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

validate against xsd

CK
I am doing a

Doc.Loadxml(myxml)
and I have an xsd schema that I want to validate the myxml against. How can
I do this. code would help.
Thanks in advance.
Nov 12 '05 #1
1 1266
You can either inline your schema or reference it in your XML document and
then use the XmlValidatingReader to validate as follows:

XmlDocument doc = new XmlDocument();
XmlTextReader tr = new XmlTextReader("data.xml");
XmlValidatingReader reader = new XmlValidatingReader(tr);
doc.Load(reader);

Thanks,
Mujtaba.

"CK" <jo*****@hotmail.com> wrote in message
news:eK**************@TK2MSFTNGP10.phx.gbl...
I am doing a

Doc.Loadxml(myxml)
and I have an xsd schema that I want to validate the myxml against. How can I do this. code would help.
Thanks in advance.

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: QuantDev | last post by:
Hi NG, I would need to validate an XML fragment against a type defined within an XSD (which defines many other things). What is the correct way of achieving this? QD2004
1
by: Ron Rohrssen | last post by:
I've been working on learning XML schemas and trying to make use of the MS classes for validating data against a schema. So, I've been trying to work through some simple schemas and instances....
1
by: aevans1108 | last post by:
Greetings All If this is the wrong place to post this question, please give me a push in the right direction. Thanks. I know there has to be a simpler way to do this, but this is as simple a...
6
by: LesleyW | last post by:
Hi Apologies if this is a really dumb question, but being new to XML and Schemas, I wonder if giving the namespace for eg xsd or xsi as a website address means that the user has to be online...
3
by: CK | last post by:
I am doing a Doc.Loadxml(myxml) and I have an xsd schema that I want to validate the myxml against. How can I do this. code would help. Thanks in advance.
7
by: Ali-R | last post by:
Hi all, I am getting a CSV file like this from our client: "C1","2","12344","Mr","John","Chan","05/07/1976"......... I need to validate **each filed value** against a set of rules ,for...
4
by: Mr. x | last post by:
Hello, I know about the validator on : http://validator.w3.org , which can validate html pages. I just new to this validator. How can I validate (if it can be - by this validator) aspx pages,...
2
by: John H | last post by:
Hi, How can i just use the XmlDocument object to validate an xml instanace against a schema referenced inside the xml instance? The Load method seems to not validate it against the schema. ...
3
by: Rushi | last post by:
Hi All, Is it possible to Validate XML against XSD using two different XML files. scenario: There are two different XML file, one file contain element and count information and other one...
1
by: engwar | last post by:
The title says it all. How do I use XMLDocument.Validate() against a DTD. In all my Googling about this I only find examples of how to validate an XMLReader or XmlValidatingReader against a DTD....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.