469,338 Members | 7,993 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,338 developers. It's quick & easy.

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 13779
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Mark Broadbent | last post: by
4 posts views Thread by ESPN Lover | last post: by
8 posts views Thread by a | last post: by
5 posts views Thread by Sumana | last post: by
4 posts views Thread by Kuldeep | last post: by
3 posts views Thread by KWienhold | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.