473,698 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2336
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*******@yaho o.nospammin.com > skrev i en
meddelelse news:46******** *************** ***********@mic rosoft.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*******@yaho o.nospammin.com > wrote in message
news:46******** *************** ***********@mic rosoft.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
6822
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 elements, attributes, ".", and "..", plus also the "" predicate format is supported - however, only one predicate per path step is supported, and expr must be a relative path. 2. Poor performance
1
1936
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? what are webservices clients.........websites? or other webservices? or both?
0
2178
by: Bernd Oninger | last post by:
What is the difference between parser.setContentHandler and parser.setErrorHandler for a XMLParser ?
12
2856
by: Sean | last post by:
Hi, I have the following script: ----------------------------------------------------------------------------------- <script type="text/javaScript"> <!-- document.write('<div id=hello1>Hello1</div>'); document.write('<div id=hello2 style="display:none;"><script src="test.js"><\/script></div>');
4
2650
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 might be a better option if someone wants to tutor me in it): $fileID = @fopen($_SERVER . '/stuff.xml', 'rb'); //
6
7376
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 source code. Although this has some overlap with say a compiler it would also seem significantly different too.
0
2234
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): PERL5LIB=/Users/Ric/Library/Perl/ ls XML-Parser-2.34/ XML-Parser-2.34.tar
18
4719
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: from pyparsing import * grammar = OneOrMore(Word(alphas)) + Literal('end') grammar.parseString('First Second Third end')
4
2568
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
0
8611
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7741
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.