Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Progressive Parsing using Xerces C++

Reply
Thread Tools

Progressive Parsing using Xerces C++

 
 
Girish
Guest
Posts: n/a
 
      04-07-2005
Hi All,

I have written a component(ATL COM) that wraps Xerces C++ parser.
I am firing necessary events for each of the notifications that I have
handled for the Content and Error handler. The events can then I am
able to parse XML input in the form of files.
I also have provided support for parsing of XML content in the form of
string data. I am able to do so by creating a MemBufInputSource object
using the XML content provided to the component. In this case I am
providing the full data as input. I want to avoid keeping the entire
xml content into memory.

Is it possible to parse the same XML content in chunks i.e. in a
progressive manner? Another scenarion could be that the data is passed
in chunks to the component for parsing? Can we use the ParseFirst and
ParseNext methods to achieve this?

Thanking you in advance!

regards,
Girish
 
Reply With Quote
 
 
 
 
Fabien R
Guest
Posts: n/a
 
      04-11-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) (Girish) wrote in message news:<(E-Mail Removed). com>...
> Hi All,
>
> I have written a component(ATL COM) that wraps Xerces C++ parser.
> I am firing necessary events for each of the notifications that I have
> handled for the Content and Error handler. The events can then I am
> able to parse XML input in the form of files.
> I also have provided support for parsing of XML content in the form of
> string data. I am able to do so by creating a MemBufInputSource object
> using the XML content provided to the component. In this case I am
> providing the full data as input. I want to avoid keeping the entire
> xml content into memory.
>
> Is it possible to parse the same XML content in chunks i.e. in a
> progressive manner?

Why don't you use the SAX API of Xerces ?
-
Fabien
 
Reply With Quote
 
 
 
 
Girish
Guest
Posts: n/a
 
      04-11-2005
Hi,

My apologies for not framing the issue properly. Here is the
updated one.

I have written a component(ATL COM) that wraps Xerces C++ parser.
I am firing necessary events for each of the methods that I have
handled for the Content and Error handler. These events can be trapped
at the client end. I am able to successfuly parse XML input in the
form of files.

I also have provided support for parsing of XML content in the
form of string data. To do so I create a "MemBufInputSource" object
from the input and pass it to the parse method. Here I am providing
the entire xml data as input. This approach is workable but will cause
problems when I have a large amount of data to be parsed. I will have
to load the entire data into memory.

The alternative to the above approach is too get the xml data in
chunks and then parse it. I have few queries related to this approach:
Is it possible to parse XML content in chunks i.e. in a progressive
manner?

I have tried the ParseFirst and ParseNext methods to achieve this. But
here again the entire data is to be passed or pointed to in parseFirst
method. Is there some other way to use these methods?

Thanking you in advance!

regards,
Girish


(E-Mail Removed) (Girish) wrote in message news:<(E-Mail Removed). com>...
> Hi All,
>
> I have written a component(ATL COM) that wraps Xerces C++ parser.
> I am firing necessary events for each of the notifications that I have
> handled for the Content and Error handler. The events can then I am
> able to parse XML input in the form of files.
> I also have provided support for parsing of XML content in the form of
> string data. I am able to do so by creating a MemBufInputSource object
> using the XML content provided to the component. In this case I am
> providing the full data as input. I want to avoid keeping the entire
> xml content into memory.
>
> Is it possible to parse the same XML content in chunks i.e. in a
> progressive manner? Another scenarion could be that the data is passed
> in chunks to the component for parsing? Can we use the ParseFirst and
> ParseNext methods to achieve this?
>
> Thanking you in advance!
>
> regards,
> Girish

 
Reply With Quote
 
Nick Kew
Guest
Posts: n/a
 
      04-11-2005
Girish wrote:

> I have tried the ParseFirst and ParseNext methods to achieve this. But
> here again the entire data is to be passed or pointed to in parseFirst
> method. Is there some other way to use these methods?


What you're looking for is a parseChunk API. Available in expat and
libxml2, but not in Xerces.

--
Nick Kew
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert progressive jpg to non-progressive jpg Sniper Abandon Ruby 0 05-15-2009 10:42 AM
How to output progressive video from a video card to a progressive CRT TV? kopn@hotbox.ru DVD Video 4 09-13-2006 07:22 AM
Upgrade of Xalan 1.2.2 and Xerces 1.4.4 to Xalan 2.6 and Xerces 2.6.2 cvissy XML 0 11-16-2004 07:06 AM
Progressive scan dvd's on a non-progressive scan tv jack lift DVD Video 7 12-09-2003 06:01 PM
parsing XML to DOM, validating against a local DTD, using Xerces under JAXP? bugbear XML 0 08-28-2003 09:22 AM



Advertisments