Mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Horta Tosas, Joan" <joan.ho...@tecsidel.es>
Subject RE: Getting an XNIException when throwing a SAXException in startElement/endElement in a handler
Date Tue, 12 Jun 2007 07:41:13 GMT
Hi again, Mr. Michael Glavassevich.

	I'm writing just to say that you were right, so if anybody else has this problem, make them
know that this can be their solution.

Joan Horta Tosas
Toll Area
 
Tecsidel 
Avda. República Argentina 6, 5ª planta
08023 Barcelona
Tel:      (+34) 93 292 21 10
Ext:      1125
http://www.tecsidel.es
 
-----Mensaje original-----
De: Michael Glavassevich [mailto:mrglavas@ca.ibm.com] 
Enviado el: lunes, 11 de junio de 2007 19:48
Para: j-users@xerces.apache.org
Asunto: Re: Getting an XNIException when throwing a SAXException in startElement/endElement
in a handler

Hi Joan,

In the system properties you're setting you're missing the schema language 
from the name of the validation property:

It should be: 
javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema=org.apache.xerces.jaxp.validation.XMLSchemaFactory

Instead of Xerces you were probably getting Sun's implementation when you 
tried this. Note the "com.sun.org.apache.xerces" package name which comes 
from their fork of the Xerces codebase. Perhaps the XNIException which was 
thrown from parse() is due to a bug in their code.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

"Horta Tosas, Joan" <joan.horta@tecsidel.es> wrote on 06/11/2007 08:30:08 
AM:

> Hi,
> 
>    I've got a weird behavior during the call to a SAX Parser (using 
> Xerces 2.9.0) parse method (passing a File and an handler that 
> extends org.xml.sax.helpers.DefaultHandler). If I throw a 
> SAXException inside my own implementation of startElement or 
> endElement, the call to parse the document receives a com.sun.org.
> apache.xerces.internal.xni.XNIException with the SAXException I 
> throw within it. I think that this isn't how it should behave, and 
> looked inside the documentation, JIRA, and a little in the code, but
> found no answer why is this happening. If this could be a bug, I'll 
> post it on JIRA, but I would like someone to confirm it before, 
> because maybe I'm doing something wrong.
> 
>    The way the parser is configured is shown on the code below:
>       SAXParserFactory saxFactory = SAXParserFactory.newInstance();
>       saxFactory.setNamespaceAware(true);
>       saxFactory.setSchema(xmlSchema);
>       this.parser = saxFactory.newSAXParser();
> 
>    The parsers are Xerces ones, choosen using System properties 
> (I've checked this also using debug)
>       org.xml.sax.driver=org.apache.xerces.parsers.SAXParser
>       javax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.
> SAXParserFactoryImpl
>       javax.xml.validation.SchemaFactory=org.apache.xerces.jaxp.
> validation.XMLSchemaFactory
> 
>    Thanks in advance to any responses.
> 
> 
> ________________________________________
> Joan Horta Tosas
> ________________________________________
> Àrea de Peatge
> 
> Tecsidel 
> Avda. República Argentina 6, 5ª planta
> 08023 Barcelona
> Tel:      (+34) 93 292 21 10
> Ext:      1125
> http://www.tecsidel.es
>  
> 
> 
> 
> La información que se incluye en este mensaje es confidencial y 
> puede ser privada a nivel legal. Las vistas u opiniones que se 
> expresan en este mensaje de correo electrónico son propiedad 
> exclusiva del autor.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org



La información que se incluye en este mensaje es confidencial y puede ser privada a nivel
legal. Las vistas u opiniones que se expresan en este mensaje de correo electrónico son propiedad
exclusiva del autor.

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Mime
View raw message