473,405 Members | 2,310 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.

Progressive Parsing using Xerces C++

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
Jul 20 '05 #1
3 3040
gc*******@gmail.com (Girish) wrote in message news:<ac**************************@posting.google. 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
Jul 20 '05 #2
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
gc*******@gmail.com (Girish) wrote in message news:<ac**************************@posting.google. 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

Jul 20 '05 #3
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
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: bugbear | last post by:
Subject pretty much says it all. I'd like to parse XML (duh!) using Xerces (because its fast, and reliable, and comprehensive, and supports lots of features). I'd like to conform to standards...
5
by: Aleksandar Matijaca | last post by:
Hi there, I am in some need of help. I am trying to parse using the apache sax parser a file that has vaid UTF-8 characters - I keep end up getting a sun.io.MalformedInputException error. ...
1
by: Hans Bijvoet | last post by:
Hello, I'm trying to parse a HTML document with the SAX parser from Xerces. The parser throws a fatal error when attribute values in the document are not surrounded by quotes? How can I prevent...
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...
1
by: Jens Mueller | last post by:
Hi there, this is a Java-XML Question, so I am not sure whether this is the right place, haven't found anything better .... I try to convert a Java object to XML via SAX and let the FOP...
8
by: pradeepsarathy | last post by:
Hi all, Does the SAX parser has eventhandlers for parsing xml schema. Can we parse the xml schema the same way as we parse the xml document using SAX Parser. Thanks in advance. -pradeep
1
by: christian.eickhoff | last post by:
Hi, I have a general question regarding the parsing of XSD files, referenced within the namespace using Apache Xerces 2.7.0 (CDT). My current c++ application can parse and validate an XML file...
24
by: Marc Dubois | last post by:
hi, is it possible to parse an XML file in C so that i can fulfill these requirements : 1) replace all "<" and ">" signs inside the body of tag by a space, e.g. : Example 1: <fooblabla < bla...
1
by: Sidhartha | last post by:
Hi, I am facing a problem while parsing local language characters using sax parser. We use DOM to parse and SAX to read the source. But when our application parses strings with local language...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.