472,127 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 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 13874
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 leo001 | last post: by

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.