HHow to write an xml parser based on an xsd?

  • Thread starter Thread starter jens Jensen
  • Start date Start date
J

jens Jensen

I'm given an xml schema an i need to parse xml based data receive via http
post and produce response .

How can i parse the xml based on the .xsd file.



many thanks

JJ
 
Jens,
The xsd provides the XML Schema to which the XML document must conform.
So what you are really asking is "how to I load an Xml Document and validate
it against this xsd schema".

You can find good example code on MSDN and elsewhere by searching on
"C#" XML "Schema validation"

Peter
 
Great ,
Thanks


Peter Bromberg said:
Jens,
The xsd provides the XML Schema to which the XML document must conform.
So what you are really asking is "how to I load an Xml Document and
validate
it against this xsd schema".

You can find good example code on MSDN and elsewhere by searching on
"C#" XML "Schema validation"

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
 
Peter Bromberg said:
Jens,
The xsd provides the XML Schema to which the XML document must conform.
So what you are really asking is "how to I load an Xml Document and validate
it against this xsd schema".

You can find good example code on MSDN and elsewhere by searching on
"C#" XML "Schema validation"

Peter
....

Additionaly, XSD.exe that comes with FrameworkSDK, can generate C# class(es)
that map to XSD shema.

Regards,
Goran
 
Thank you for the help. Does someone know how i can read posted data (xml)
to an httphandler?

JJ
 
You should be able to load the ResponseStream directly into an XmlDocument
object. Look at the overloads of the XmlDocument Load method.
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top