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: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

"Horta Tosas, Joan" <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to