[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

SAX Parser Raises Error Event Before startElement Event

  • To: xml-dev@l...
  • Subject: SAX Parser Raises Error Event Before startElement Event
  • From: "Bart Stok" <bart_stok@h...>
  • Date: Fri, 14 May 2004 08:45:11 +0000
  • Bcc:

sax parser startelement
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

_________________________________________________________________
MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.