473,566 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

parsing an xml

sp
i have an xml file (an rss file)

<?xml version="1.0" ?>
<rss version="2.0">
<channel>
<title>CodeGuru .com</title>
<link>http://www.codeguru.co m/</link>
<description>Th e number one developer site!</description>
<language>en-us</language>
<lastBuildDate> Mon, 13 Feb 2006 09:52:05 EST</lastBuildDate>
<copyright>Copy right 1996-2005 Jupitermedia Corporation</copyright>
<managingEditor >rs*@jupitermed ia.com</managingEditor>
<webMaster>rs*@ jupitermedia.co m</webMaster>
<docs>http://backend.userlan d.com/rss</docs>
<ttl>60</ttl>
<item>
<title>Matrix-Like Credits for MFC Applications</title>

<link>http://redir.internet. com/rss/click/www.codeguru.co m/cpp/controls/controls/coolcontrols/article.php/c7343</link>

<description>Th is simple class displays Matrix-like credits in MFC
applications.</description>
<pubDate>02/13/2006</pubDate>
</item>
<item>
<title>Internat ionalize and Localize Your C/C++ Code with ICU</title>
<link>http://redir.internet. com/rss/click/www.codeguru.co m/cpp/misc/misc/multi-lingualsupport/article.php/c11403</link>

<description>Th e International Component for Unicode (ICU) library
can save you from being hopelessly mired in numerous character
encodings as your C/C++ application matures into internationaliz ation
and localization.</description>
<pubDate>02/10/2006</pubDate>
</item>
<item>
<title>MFC Extension Classes CListCtrlEx and CListViewEx</title>

<link>http://redir.internet. com/rss/click/www.codeguru.co m/cpp/controls/listview/advanced/article.php/c4179</link>

<description>Au gmented versions of CListCtrl and CListView with sort
direction indicators, coloring of the sort column, column hiding, and
more.</description>
<pubDate>02/08/2006</pubDate>
</item>
<item>
<title>Mould Text in Any Shape</title>

<link>http://redir.internet. com/rss/click/www.codeguru.co m/cpp/misc/misc/graphics/article.php/c10673</link>

<description>So metimes, putting text in a rectangular block may just
be a little too straight. With the C++ class QEnvelopeText, you can
mould a piece of body type in any shape.</description>
<pubDate>02/07/2006</pubDate>
</item>
<item>
<title>Capturin g Windows Regardless of Their Z-Order</title>

<link>http://redir.internet. com/rss/click/www.codeguru.co m/cpp/g-m/gdi/capturingimages/article.php/c11231</link>

<description>Ca pture a top window content to a BMP file, regardless
of the z-order of the window.</description>
<pubDate>02/07/2006</pubDate>
</item>
<item>
<title>Secure C++: Checked Iterators for Safer STL Coding</title>

<link>http://redir.internet. com/rss/click/www.codeguru.co m/cpp/com-tech/atl/misc/article.php/c11361</link>

<description>Th e security issues with Standard C++ aren't as severe
as those of C and the CRT, but a few exploits are possible if you
misuse STL and iterators.</description>
<pubDate>02/03/2006</pubDate>
</item>
<item>
<title>BizTal k 2004 Adapter Alternatives for Handling Web
Services</title>

<link>http://redir.internet. com/rss/click/www.codeguru.co m/cpp/misc/misc/applicationcont rol/article.php/c11333</link>

<description>Co mbine BizTalk 2004 with the .NET Framework to overcome
some of BizTalk's limitations in handling Web services.</description>
<pubDate>02/01/2006</pubDate>
</item>
<item>
<title>WinFS Basics: Working with a Data Store</title>

<link>http://redir.internet. com/rss/click/www.codeguru.co m/cpp/data/mfc_database/storedprocedure s/article.php/c11313</link>

<description>In troducing the next step in information storage on the
Windows platform: WinFS, an active storage platform. Learn the basic
operations that you can perform on a WinFS data store.</description>
<pubDate>01/30/2006</pubDate>
</item>
<item>
<title>Tree Container Library</title>

<link>http://redir.internet. com/rss/click/www.codeguru.co m/cpp/misc/misc/templatizedclas ses/article.php/c11203</link>

<description>Th e TCL consists of three templatized container classes,
similar to those found in the STL.</description>
<pubDate>01/30/2006</pubDate>
</item>
<item>
<title>TIP: Half Size Triangular Matrix</title>

<link>http://redir.internet. com/rss/click/www.codeguru.co m/cpp/cpp/algorithms/general/article.php/c11211</link>

<description>Le arn about a technique that allows you to use half the
data storage when you have a symmetric distance matrix or other similar
triangular matrix.</description>
<pubDate>01/18/2006</pubDate>
</item>
</channel>
</rss>

my application processes these xml(rss) files and keeps updating the
user about any change in the news if any thing is changed i have to
reflect it in my application

i parse the xml file and store it in a datastructure which is a
CStringArray (in vc++) while parsing i am comparing the tag of the xml
file to push it in the proper array.

is there any other way to process these xml file such that i dont need
to compare the nodes to push into properdatastruc ture.

so that that can improve my performance i am using MSXML2 for my
purpose and using SelectNodes i am iterating the list of item tags and
comparing its child tags i am populating it

anyone can help me in providing better implementation

-praveen

Feb 14 '06 #1
1 1882

sp wrote:
i have an xml file (an rss file)
Please don't post huge chunks of boilerplate code. Paste a link to it
instead. Many of the problems discussed here can only be seen "in the
wild".

my application processes these xml(rss) files and keeps updating the
user about any change in the news if any thing is changed i have to
reflect it in my application
Files ? Or web documents ? Are you creating these documents or
reading them?

i parse the xml file and store it in a datastructure which is a
CStringArray (in vc++) while parsing i am comparing the tag of the xml
file to push it in the proper array.
The "tag" is always the same - <link> or somesuch. What are you really
comparing here? The content of the <item> ? Or just the URL in the
<link> ?
is there any other way to process these xml file such that i dont need
to compare the nodes to push into properdatastruc ture.


It's hard to know from your sparse description, but I imagine that
comparing the item URLs (in the <link> element) is both necessary and
sufficient. In a well-run RSS feed these will be stable, simple and
unique to items.

In a poorly run feed then they might have parameters (order is probably
insignificant, but it can confuse the comparator if this changes), they
might have trivial optional parameters and worst of all they might be
of the form "?id=1"... where they change between successive versions of
the feed whilst still referring to the same items. In these cases you
might need to hash the content of the item and compare that.

Feb 14 '06 #2

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

Similar topics

8
9430
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
3930
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
2869
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...
0
4108
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
4047
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...
5
4289
by: randy | last post by:
Can some point me to a good example of parsing XML using C# 2.0? Thanks
3
4367
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
4475
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
2395
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...
1
4358
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...
0
7673
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...
0
7893
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. ...
1
7645
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7953
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5485
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...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2085
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
0
926
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...

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.