By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,198 Members | 897 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,198 IT Pros & Developers. It's quick & easy.

Parsing XML

P: n/a
Can some point me to a good example of parsing XML using C# 2.0?

Thanks
Aug 29 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
It really depends what you want to do ;-p

For smaller xml and a richer model, then XmlDocument is your friend:

XmlDocument doc = new XmlDocument();
doc.Load(path);
// or doc.LoadXml(xmlString);

For efficient handling of larger xml, but a much thinner model
(firehose, one element at a time), look at XmlReader over a stream.

Marc

Aug 29 '06 #2

P: n/a
More appropriate should be .Net framework 2 because C# is managed code too.
Hope this help:
http://msdn.microsoft.com/msdnmag/is...n/default.aspx

chanmm
"randy" <ra***@d.comwrote in message
news:eR**************@TK2MSFTNGP06.phx.gbl...
Can some point me to a good example of parsing XML using C# 2.0?

Thanks

Aug 29 '06 #3

P: n/a


randy wrote:
Can some point me to a good example of parsing XML using C# 2.0?
This <http://www.asp.net/QuickStart/howto/doc/Xml/OverviewofXML.aspx>
should help.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Aug 29 '06 #4

P: n/a
XML is a format which can represent literally any kind of data. The .Net CLR
is rich with various tools for working with various types of XML documents,
and as you might expect, there are different tools for different types of
documents. There are tools for serializing and de-serializing XML-serialized
classes. There are tools for editing and parsing XSL transforms, and tools
for working with XSD style sheet documents as well. In addition, there are
tools for other types of XML documents, and low-level pure XML-parsing
tools. So, it really depends on what you want to do. What sort of XML are
you working with?

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

It takes a tough man to make a tender chicken salad.
"randy" <ra***@d.comwrote in message
news:eR**************@TK2MSFTNGP06.phx.gbl...
Can some point me to a good example of parsing XML using C# 2.0?

Thanks

Aug 29 '06 #5

P: n/a
Thanks for the post. The xml is from another application. I need to parse
the xml for the following:

1) One XML document received needs to parsed and the data is then sent out
in a new request.
2) The other XML document received will be parsed to be stored in a db
(mapped to a business object) and the document will be sent to the UI to be
displayed to the user using XSL transforms.

I need the parsing to be quick. I playing with the idea of mapping the xml
document into an object for the first scenerio but i thought parsing could
be quicker.

Thanks

"Kevin Spencer" <uc*@ftc.govwrote in message
news:eb**************@TK2MSFTNGP04.phx.gbl...
XML is a format which can represent literally any kind of data. The .Net
CLR is rich with various tools for working with various types of XML
documents, and as you might expect, there are different tools for
different types of documents. There are tools for serializing and
de-serializing XML-serialized classes. There are tools for editing and
parsing XSL transforms, and tools for working with XSD style sheet
documents as well. In addition, there are tools for other types of XML
documents, and low-level pure XML-parsing tools. So, it really depends on
what you want to do. What sort of XML are you working with?

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

It takes a tough man to make a tender chicken salad.
"randy" <ra***@d.comwrote in message
news:eR**************@TK2MSFTNGP06.phx.gbl...
>Can some point me to a good example of parsing XML using C# 2.0?

Thanks


Aug 29 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.