Can I get the value of a specified tag quickly with SAX parser?

perybutler

New Member
I want to make a progress bar while importing my articles from an XML feed.The parsing works fine, but for my progress bar I need to quickly know the total # of \[code\]<item>\[/code\]s in the feed so I can determine percentage that have been loaded.My thought was, it would be a lot faster to just do this in PHP and add the "count" to the feed itself - something like this:\[code\]<?xml version="1.0" encoding="utf-8"?><channel><title>My Apps Feed</title><link>http://link_to_this_fiel</link><language>en-us</language><count>42</count>\[/code\]But then I need to be able to quickly access that "count" number.At the moment, I have an \[code\]RSSHandler.java\[/code\] that's being called like this:\[code\]//Add all items from the parsed XMLfor(NewsItem item : parser.getParsedItems()){ //...\[/code\]
 
Back
Top