Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Problem regarding SAXParser

Reply
Thread Tools

Problem regarding SAXParser

 
 
manish23@gmail.com
Guest
Posts: n/a
 
      12-20-2006
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

 
Reply With Quote
 
 
 
 
Pete Becker
Guest
Posts: n/a
 
      12-20-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
>
> I am using SAXParser to parse th file as shown in code below:
>


SAXParser isn't part of the C++ standard library. You should ask whoever
you got it from.

--

-- Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." (www.petebecker.com/tr1book)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SAXParser xinclude problem Andi Java 6 12-03-2008 09:43 AM
libxml SaxParser Problem funkdoobiest Ruby 2 12-20-2007 12:28 PM
libxml's SaxParser and UTF-8 problem Peter Higgins Ruby 2 03-07-2007 02:06 PM
Problem with SaxParser. Works Occasionally. stacey Java 11 03-06-2007 12:53 AM
Problem regarding SAXParser manish23@gmail.com XML 0 12-20-2006 10:55 AM



Advertisments