473,383 Members | 2,005 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,383 software developers and data experts.

SAX Parser Raises Error Event Before startElement Event

Hello all,

I'm trying to catch the element name when a SAXParseException (error)
occurs. It was my intention to get the element's name with the
startElement(..String localName....) and then if a SAXParseException
is thrown, I know the element's name.
However, I discovered that a SAXParseException for a particular
element is thrown before the startElement event!!!!! So, during the
exception I will not know which element has got a problem. Of course,
I can use the getMessage() method of the SAXParseException. But the
exceptionmessage is useless to me, because i have to show it to an end
user and the message is too long to show to an end-user.
I don't think this is good behaviour.

I have 3 questions:
- Is the sequence of events and exceptions defined anywhere? I already
searched the web for the answer to this question but I only found a
description of the sequence of events :
http://www.mds.rmit.edu.au/~msf/misc/SAXEvents.html
- Is there an other way to get the element's name when a
SAXParseException is thrown? I know of the properties
http://xml.org/sax/properties/dom-node
and http://xml.org/sax/properties/xml-string . But these properties
are not supported by Xerces.
- I validate the XML with an xsd. Is there any way to make custom
parse error messages?

I hope someone can help me with these questions, because I already
worked for 2 weeks on this problem. Please tell me if something is not
clear.

greetings,
Bart
Jul 20 '05 #1
0 1016

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

Similar topics

2
by: Cees Wesseling | last post by:
Hi, it seems that xmlproc, the default Validating parser, in my setup does not call back to setDocumentLocator. Is there anyway to get a locator in my handler? Below you find an example and its...
1
by: H.L Bai | last post by:
hi, everybody i meet a parse error when i used the xml4c. any proposal is helpful. The error is following .../XMLRegionHandler.h:59 parse error before '*' .../XMLRegionHandler.h:60 parse...
1
by: Vineeth | last post by:
Hi, I am using xerces2.6.0 and am developing a program for converting an xml document to a text file. My program is extending the DefaultHandler. The first problem I am facing is that even...
1
by: Kirill Osipov | last post by:
Hello everybody. Can anyone help me? I'm writing a server control which raises events. On MSDN I've read a lot about events and saw a bunch of samples illustrating the mechanism of events. Among...
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: ...
1
by: RamaKrishna Narla | last post by:
Hi, We are using Xalan1.4/Xerces2.1 SAX parser in C++. We have extended DocumentHandler class, and registered its object using setDocumentHandler method. SAX Parser is reporting the document...
5
by: PatlaDJ | last post by:
Java SAX parser, please need a clue how to get the raw XML code of the currently parsing event... needed for logging, debugging purposes. Here's and example, letting me clarify exactly what i...
4
by: manu | last post by:
Hi, I need to parse xml files for the Blender Game Engine. ATM I am trying to get this script running in the BGE. This is my first script and I dont have much experience programming... import...
6
by: Naresh Agarwal | last post by:
Hi I have been using DOM parser to create XML documents. I want to use an alternate mechanism to create XML document as size of my XML document is large and I don;t want the overhead of DOM...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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: 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...

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.