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

Problem regarding SAXParser

Hi

I am trying to parse an xml document with the following header
<?xml version="1.0" encoding="utf-8"?>

I am using SAXParser to parse th file as shown in code below:

SAXParser sax;

MemBufInputSource buf((const XMLByte*) text.chars( CHARSET_UTF_8
),text.b_length( CHARSET_UTF_8 ), buffer_name); //text contains actual
xml file to be parsed
try
{
sax.parse(buf); //fail here
}
catch (const SAXException& e)
{
fprintf(stderr,"Exception thrown: %s", e.what());
}
catch (std::exception &e)
{
fprintf(stderr,"Exception thrown: %s", e.what());

// Close everything down here and present an error message
}
catch (...)
{
fprintf(stderr,"INSIDE ELIPSES");
}

The problem is that the code is failing at sax.parse method. And also
there is no exception being thrown because of which i am unable to
figure out why the parse method is failing.
So is this because there is some problem with the encoding scheme of
the document or something else? And why is it not throwing any
exceptions?

Kindly provide any suggession in this regard

Thanks

Dec 20 '06 #1
0 1072

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

Similar topics

2
by: Programatix | last post by:
Hi, I'm working on a project which includes WebServices and Windows Form application. The Windows Form application will call the WebServices to retrieve data from database. The data will be...
1
by: Zandy Marantal | last post by:
Hello everyone, I'm having trouble using Xerces2(2.4, 2.5) when validating against an XML schema if a general entity reference is defined within the XML file. The error I'm getting is this:...
0
by: hitectahir | last post by:
Hi, I have been using the SAXParser class of Xerces to parse some 40-60 K of XML on PersonalJava on an iPAQ. but it takes too much time (almost 30-40 seconds). Can anybody tell me if there are...
0
by: Jonathan | last post by:
I have written a SAX parser to read a simple XML file using this code : SAXParserFactory factory = SAXParserFactory.newInstance(); javax.xml.parsers.SAXParser saxParser =...
2
by: Frederik Himpe | last post by:
I'm implementing a SAX handler with libxml++. I have this piece of code: void PalamedeParser::on_start_element(const std::string &name, const AttributeList &attributes) { AttributeList::iterator...
7
by: Kirt | last post by:
i have walked a directory and have written the foll xml document. one of the folder had "&" character so i replaced it by "&amp;" #------------------test1.xml <Directory> <dirname>C:\Documents and...
0
by: christophe_usenet | last post by:
Hi, I'm new to XML, and i'm trying to make a dummy SAX parser with Xerces-C 2.6.0-3. Unfortunately, though it compiles, it does not produce any output :-( Here is the code: ...
0
by: Undeclared | last post by:
Hello! My goal is to use JAXP for creating SAX parser with my own XMLParserConfiguration. For example, in package org.apache.xerces.parsers there is a constructor: public...
1
by: manish23 | last post by:
Hi I am trying to parse an xml document with the following header <?xml version="1.0" encoding="utf-8"?> I am using SAXParser to parse th file as shown in code below: SAXParser sax; ...
0
by: mahesh123 | last post by:
Hi, I am new to use the crystal reports8.0. I am facing the problem regarding the database connection through the ADO Connection. Suppose my database name is "sample.pra"(due to some security...
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
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.