473,782 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parsing XML

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

Thanks
Aug 29 '06 #1
5 4307
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(xml String);

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
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.comwro te in message
news:eR******** ******@TK2MSFTN GP06.phx.gbl...
Can some point me to a good example of parsing XML using C# 2.0?

Thanks

Aug 29 '06 #3


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.a spx>
should help.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Aug 29 '06 #4
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.comwro te in message
news:eR******** ******@TK2MSFTN GP06.phx.gbl...
Can some point me to a good example of parsing XML using C# 2.0?

Thanks

Aug 29 '06 #5
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.govwro te in message
news:eb******** ******@TK2MSFTN GP04.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.comwro te in message
news:eR******** ******@TK2MSFTN GP06.phx.gbl...
>Can some point me to a good example of parsing XML using C# 2.0?

Thanks


Aug 29 '06 #6

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

Similar topics

8
9446
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $ Last-Modified: $Date: 2003/10/28 19:48:44 $ Author: A.M. Kuchling <amk@amk.ca> Status: Draft Type: Standards Track
2
3958
by: Cigdem | last post by:
Hello, I am trying to parse the XML files that the user selects(XML files are on anoher OS400 system called "wkdis3"). But i am permenantly getting that error: Directory0: \\wkdis3\ROOT\home Canonicalpath-Directory4: \\wkdis3\ROOT\home\bwe\ You selected the file named AAA.XML getXmlAlgorithmDocument(): IOException Not logged in
16
2907
by: Terry | last post by:
Hi, This is a newbie's question. I want to preload 4 images and only when all 4 images has been loaded into browser's cache, I want to start a slideshow() function. If images are not completed loaded into cache, the slideshow doesn't look very nice. I am not sure how/when to call the slideshow() function to make sure it starts after the preload has been completed.
0
4131
by: Pentti | last post by:
Can anyone help to understand why re-parsing occurs on a remote database (using database links), even though we are using a prepared statement on the local database: Scenario: ======== We have an schema (s1) on an Oracle 9i database with database links pointing to a schema (s2) on another Oracle 9i database.
9
4062
by: ankitdesai | last post by:
I would like to parse a couple of tables within an individual player's SHTML page. For example, I would like to get the "Actual Pitching Statistics" and the "Translated Pitching Statistics" portions of Babe Ruth page (http://www.baseballprospectus.com/dt/ruthba01.shtml) and store that info in a CSV file. Also, I would like to do this for numerous players whose IDs I have stored in a text file (e.g.: cobbty01, ruthba01, speaktr01, etc.)....
3
4386
by: toton | last post by:
Hi, I have some ascii files, which are having some formatted text. I want to read some section only from the total file. For that what I am doing is indexing the sections (denoted by .START in the file) with the location. And for a particular section I parse only that section. The file is something like, .... DATAS
13
4515
by: Chris Carlen | last post by:
Hi: Having completed enough serial driver code for a TMS320F2812 microcontroller to talk to a terminal, I am now trying different approaches to command interpretation. I have a very simple command set consisting of several single letter commands which take no arguments. A few additional single letter commands take arguments:
7
2410
by: Daniel Fetchinson | last post by:
Many times a more user friendly date format is convenient than the pure date and time. For example for a date that is yesterday I would like to see "yesterday" instead of the date itself. And for a date that was 2 days ago I would like to see "2 days ago" but for something that was 4 days ago I would like to see the actual date. This is often seen in web applications, I'm sure you all know what I'm talking about. I'm guessing this...
1
4407
by: eyeore | last post by:
Hello everyone my String reverse code works but my professor wants me to use pop top push or Stack code and parsing code could you please teach me how to make this code work with pop top push or Stack code and parsing code my professor i does not like me using buffer reader on my code and my professor did even give me an example code for parsing as well as pop push top or Stack code and i don't know how to do this code into parsing and pop push...
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8968
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
7494
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
6735
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
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.