Progressive Parsing using Xerces C++

Discussion in 'XML' started by Girish, Apr 7, 2005.

  1. Girish

    Girish Guest

    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
     
    Girish, Apr 7, 2005
    #1
    1. Advertising

  2. Girish

    Fabien R Guest

    (Girish) wrote in message news:<>...
    > 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
     
    Fabien R, Apr 11, 2005
    #2
    1. Advertising

  3. Girish

    Girish Guest

    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


    (Girish) wrote in message news:<>...
    > 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
     
    Girish, Apr 11, 2005
    #3
  4. Girish

    Nick Kew Guest

    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
     
    Nick Kew, Apr 11, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wilson k. tsugue

    how to not to show progressive content in browser

    wilson k. tsugue, Aug 20, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    344
    Kevin Spencer
    Aug 20, 2003
  2. dorayme

    progressive jpgs

    dorayme, Jun 8, 2005, in forum: HTML
    Replies:
    5
    Views:
    483
    Travis Newbury
    Jun 8, 2005
  3. Andrew Gabriel
    Replies:
    1
    Views:
    543
    Benjamin Niemann
    Sep 6, 2005
  4. cvissy
    Replies:
    0
    Views:
    640
    cvissy
    Nov 16, 2004
  5. Chris Jakeman
    Replies:
    1
    Views:
    136
    Markus Ernst
    Jul 17, 2003
Loading...

Share This Page