473,748 Members | 3,604 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 MemBufInputSour ce 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 3070
gc*******@gmail .com (Girish) wrote in message news:<ac******* *************** ****@posting.go ogle.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 MemBufInputSour ce 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 "MemBufInputSou rce" 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.go ogle.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 MemBufInputSour ce 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
4270
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 as much as possible, so I'd like to call Xerces under the JAXP API. I'd like to validate the XML against a DTD, so that errors are flagged up to the user, and I can transcribe
5
14060
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. This is my code:
1
3823
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 this parser's behaviour? Greetings, Hans
2
3957
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 Canonicalpath-Directory4: \\wkdis3\ROOT\home\bwe\ You selected the file named AAA.XML getXmlAlgorithmDocument(): IOException Not logged in
1
3108
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 Transformer convert that via XSLT to valid XSL-FO. So I define a SAXReader which fires the SAX Events for the Java Object. This works fine and the Transformation to PDF is ok. However, I have one object which contains an XHTML String and the tags
8
2704
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
3076
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 and an XSD schema, both located on my harddisk, against each other without any problems. I can therefore also parse the schema file and access it the same way than a common xml file. The question now is whether Xerces provides the possibility to...
24
2502
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 </foo> becomes <fooblabla bla </foo>
1
3502
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 especially czech,polish,turkish in place of local language character some other word is comming. Eg: Input string :ahoj, jak se máš Output string :ahoj, jak se m&aacute;š
0
8991
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9544
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.