472,805 Members | 883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 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 1836

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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?

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.