473,405 Members | 2,445 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,405 software developers and data experts.

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.com/</link>
<description>The number one developer site!</description>
<language>en-us</language>
<lastBuildDate>Mon, 13 Feb 2006 09:52:05 EST</lastBuildDate>
<copyright>Copyright 1996-2005 Jupitermedia Corporation</copyright>
<managingEditor>rs*@jupitermedia.com</managingEditor>
<webMaster>rs*@jupitermedia.com</webMaster>
<docs>http://backend.userland.com/rss</docs>
<ttl>60</ttl>
<item>
<title>Matrix-Like Credits for MFC Applications</title>

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

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

<description>The International Component for Unicode (ICU) library
can save you from being hopelessly mired in numerous character
encodings as your C/C++ application matures into internationalization
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.com/cpp/controls/listview/advanced/article.php/c4179</link>

<description>Augmented 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.com/cpp/misc/misc/graphics/article.php/c10673</link>

<description>Sometimes, 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>Capturing Windows Regardless of Their Z-Order</title>

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

<description>Capture 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.com/cpp/com-tech/atl/misc/article.php/c11361</link>

<description>The 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>BizTalk 2004 Adapter Alternatives for Handling Web
Services</title>

<link>http://redir.internet.com/rss/click/www.codeguru.com/cpp/misc/misc/applicationcontrol/article.php/c11333</link>

<description>Combine 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.com/cpp/data/mfc_database/storedprocedures/article.php/c11313</link>

<description>Introducing 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.com/cpp/misc/misc/templatizedclasses/article.php/c11203</link>

<description>The 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.com/cpp/cpp/algorithms/general/article.php/c11211</link>

<description>Learn 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 properdatastructure.

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 1868

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 properdatastructure.


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
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 $...
2
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...
16
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...
0
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...
9
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"...
5
by: randy | last post by:
Can some point me to a good example of parsing XML using C# 2.0? Thanks
3
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...
13
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...
7
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...
1
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...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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,...
0
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...

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.