473,394 Members | 1,810 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,394 software developers and data experts.

Expat XML parser in c++ application

Hi,
Our c++ application makes use of expat parser to parse an XML file. If there is a long string to be read as tag value like below:

<tag>why does expat read this string in parts</tag>

So, we have "characterValue" method registered to be called when expat encounters value. When I print the characters read by expat in this method, it does not show the entire string, but shows parts of it in subsequent calls to this registered method.
Part 1: why does exp
Part 2: at read this string
Part 3: in parts

So, we had to handle this by appending the parts in subsequent calls to characterValue until end tag is reached, and thats how we got hold of entire string. So, instead of reading it in one shot and making only one call to "characterValue" method, it sometimes makes three calls ( could take less or more ).

Here are my queries:
1) What is the criteria for this selective reading?
2) Is there a way to tell expat to read entire value in one shot?

Please note that we have enough buffer to hold the entire string.

Any help would be highly appreciated.

Thanks.
Aug 3 '11 #1
0 1303

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Doug | last post by:
I am running solaris 7 on two machines. I compiled python 2.2.1 with expat parser on one machine. The python binary is located in /usr/local/bin and the libraries are located in /usr/local/lib. ...
0
by: dagurp | last post by:
I have this code: import xml.parsers.expat parser = xml.parsers.expat.ParserCreate(encoding="UTF-8") text = unicode("<div>þórður</div>",'UTF-8') print parser.Parse(text,1) And this is what I...
1
by: Armin Steinhoff | last post by:
Hi all, is it possible to get the name of an empty element specified by <element/> ... the expat parser seems only to recognize the <element></element> form Regards Armin
2
by: Steve Juranich | last post by:
I'm running into problems where Python and VTK both ship with their own distribution of the Expat parser. As long as you never use the Python XML package, everything is fine. But if you try using...
1
by: B Mahoney | last post by:
I have a simple Kid template document: <?xml version='1.0' encoding='utf-8'?> <?python import time title = "A Kid &anything; Template" ?> <html xmlns="http://www.w3.org/1999/xhtml"...
2
by: Andy Jeffries | last post by:
Can I declare a class that will handle retrieving and parsing XML using Expat? What I mean is, can an object member function be used as the callback function for xml parsing? If so, can someone...
1
by: Sebastian Bassi | last post by:
I have this code: import xml.parsers.expat def start_element(name, attrs): print 'Start element:', name, attrs def end_element(name): print 'End element:', name def char_data(data): print...
2
by: sharan | last post by:
like for a example xml program <?xml version="1.0" encoding="ISO-8859-1"?> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note>...
1
by: sharan | last post by:
Using the expat parser (http://expat.sourceforge.net/) i have to parse the following xml file and print it on the screen in tabular format. Want a c program on that in Linux environment....
1
by: sharan | last post by:
Using the expat parser (http://expat.sourceforge.net/) i have to parse the following xml file and print it on the screen in tabular format using C language. i am getting ouput serially but not in...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
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.