473,320 Members | 1,724 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,320 software developers and data experts.

Read XML using XSD

Somebody gave me an XSD file to read a XML file. Can somebody give me an idea
how to use this XSD file in C# to start reading XML files?

Thanks, Ben
Mar 6 '07 #1
2 13930
Ben van Erp wrote:
Somebody gave me an XSD file to read a XML file. Can somebody give me an idea
how to use this XSD file in C# to start reading XML files?
You can validate an XML document against an XSD schema. With .NET 2.0
use an XmlReader with the proper XmlReaderSettings. With .NET 1.x use an
XmlValidatingReader.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Mar 6 '07 #2
There are various ways. One way is to use a dataset to read the schema, and
then the xml. You can use the ReadXMLSchema and ReadXML functions of a
dataset for this.

Another way is to create a set of typed classes out of your xsd - using xsd
tool or xsdobjectgen tool - and deserialize your xml file directly to the
object model.

--
Thanks a lot

-----------------------------------------------------------------------

Anoop Madhusudanan,
Solution Architect,
Application Development,
Sumeru Software Solutions Pvt Ltd

http://www.sumeru.com
Ph: (91)9886976328
-----------------------------------------------------------------------

visit me: http://amazedsaint.blogspot.com

= = =

"Action without doership is meditation"
"Ben van Erp" <Be*******@discussions.microsoft.comwrote in message
news:DE**********************************@microsof t.com...
Somebody gave me an XSD file to read a XML file. Can somebody give me an
idea
how to use this XSD file in C# to start reading XML files?

Thanks, Ben

Mar 7 '07 #3

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

Similar topics

9
by: ferbar | last post by:
Hi all, I'm trying to read from the txt file 'ip.packets.2.txt' using the read function. It seems everything ok, but I get a -1 when executing >>bytesr = read(fdo1, bufread, 2); The 'open'...
6
by: BBM | last post by:
I have an object that has a fairly complex construction sequence, so I have written a dedicated "factory" class that invokes the constructor of my object class (which does nothing but instantiate...
14
by: Mark Broadbent | last post by:
Does anybody know what is (factual please -not just guess) the quickest method to read data from a file? I am not interested in the format of the data (i.e. blocks, bytes, string etc) just that the...
4
by: ESPN Lover | last post by:
Below is two snippets of code from MSDN showing how to read a file. Is one way preferred over the other and why? Thanks. using System; using System.IO; class Test { public static void...
8
by: a | last post by:
I have a struct to write to a file struct _structA{ long x; int y; float z; } struct _structA A; //file open write(fd,A,sizeof(_structA)); //file close
5
by: Sumana | last post by:
Hi All, We developed our project on VC++.Net console application to create image of disk and to write the image We are having problem with reading and writing the sector beyond 6GB Disk or...
0
by: phplasma | last post by:
Hey, I am currently attempting to implement a multi-threaded C# socket, using SSL (.pem file/certification/private key combo) server using Visual Studio C# Express. I have successfully made...
4
by: Kuldeep | last post by:
Hi All, I am trying to read the contents of a page through its URL. My code snippet is as follows: public void mtdGetPageDataHWR() { HttpWebRequest objRequ =...
3
by: KWienhold | last post by:
I'm currently writing an application (using Visual Studio 2003 SP1 and C#) that stores files and additional information in a single compound file using IStorage/IStream. Since files in a compound...
3
by: Ray | last post by:
Hello World, I made a Windowsform that reads data from a CSV file. It works fine, but when I have read the data of a record I have to re-Debug the form to read another record. So when I put a...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.