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

HHow to write an xml parser based on an xsd?



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
Apr 25 '06 #1
7 2320
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


"jens Jensen" wrote:


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

Apr 25 '06 #2
Great ,
Thanks
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> skrev i en
meddelelse news:46**********************************@microsof t.com...
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


"jens Jensen" wrote:


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

Apr 25 '06 #3

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:46**********************************@microsof t.com...
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
Apr 25 '06 #4
Thank you for the help. Does someone know how i can read posted data (xml)
to an httphandler?

JJ
Apr 25 '06 #5
You should be able to load the ResponseStream directly into an XmlDocument
object. Look at the overloads of the XmlDocument Load method.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"jens Jensen" wrote:
Thank you for the help. Does someone know how i can read posted data (xml)
to an httphandler?

JJ

Apr 25 '06 #6
P.S.-
Make that "Request Stream".
Cheers.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"jens Jensen" wrote:
Thank you for the help. Does someone know how i can read posted data (xml)
to an httphandler?

JJ

Apr 25 '06 #7
>
"jens Jensen" wrote:
Thank you for the help. Does someone know how i can read posted data
(xml)
to an httphandler?

JJ


Great,
Thousands thanks
JJ
Apr 25 '06 #8

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

Similar topics

1
by: bdinmstig | last post by:
I refined my attempt a little further, and the following code does seem to work, however it has 2 major problems: 1. Very limited support for XPath features Basic paths are supported for...
1
by: Liza | last post by:
hi guys, call me dumb but how do i recognise a webservice ?? if i go to a web site and the information i put into some fields are sent to a database? is that database itself a webservice? ...
0
by: Bernd Oninger | last post by:
What is the difference between parser.setContentHandler and parser.setErrorHandler for a XMLParser ?
12
by: Sean | last post by:
Hi, I have the following script: ----------------------------------------------------------------------------------- <script type="text/javaScript"> <!-- document.write('<div...
4
by: comp.lang.php | last post by:
I have a very simple XML file I created as a sample: I am trying to simply read it using tree-based XML functions in PHP which I know (sorry, don't know or quickly understand DOM though that...
6
by: Herby | last post by:
Hi, Im interested in Reverse Engineering C++ source code into a form more comprehensible than the source itself. I want to write a basic one myself, obviously i need to write a parser for the...
0
by: UncleRic | last post by:
Environment: Mac OS X (10.4.10) on MacBook Pro I'm a Perl Neophyte. I've downloaded the XML::Parser module and am attempting to install it in my working directory (referenced via PERL5LIB env): ...
18
by: Just Another Victim of the Ambient Morality | last post by:
Is pyparsing really a recursive descent parser? I ask this because there are grammars it can't parse that my recursive descent parser would parse, should I have written one. For instance: ...
4
by: fbrewster | last post by:
I'm writing an HTML parser and would like to use Internet Explorers DOM parser. Can I use Internet Explorers DOM parser through a web service? thanks for the help
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.