Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 6th, 2007, 05:25 PM
=?Utf-8?B?QmVuIHZhbiBFcnA=?=
Guest
 
Posts: n/a
Default 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
  #2  
Old March 6th, 2007, 06:45 PM
Martin Honnen
Guest
 
Posts: n/a
Default Re: Read XML using XSD

Ben van Erp wrote:
Quote:
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/
  #3  
Old March 7th, 2007, 06:15 AM
Anoop M
Guest
 
Posts: n/a
Default Re: Read XML using XSD

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" <BenvanErp@discussions.microsoft.comwrote in message
news:DED2B302-DD6F-45D2-BC71-800221C0E6B4@microsoft.com...
Quote:
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

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles