You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Simon Kitching <sk...@apache.org> on 2006/07/03 00:24:25 UTC

RE: xsd and org.apache.commons.digester.Digester

Hi Darren,

On Fri, 2006-06-30 at 16:53 -0400, Darren Hall wrote:
> Hello again,
> 
> I fixed the earlier problem I was having with parsing my xml doc, but now
> I'm getting another one -
> 
> 2006-06-30 16:04:40,469 ERROR org.apache.commons.digester.Digester - Parse
> Error at line 2 column 13: Document is invalid: no grammar found.
> org.xml.sax.SAXParseException: Document is invalid: no grammar found.
> 
> I'm using commons-digester 1.7 and an xsd to read from my xml file.
> 
> >From the research I've been doing online, it seems this error could be
> related to the fact that I somehow need to configure the digester to let it
> know I'm validating using XML schema... but I'm not sure.
> 
> Can anyone point me in the right direction as far as solving this problem?

Configuring validation of an xml document against a schema is
unfortunately not standardised; it varies by parser implementation. And
it is a little tricky to get right.

I therefore recommend that you create the parser instance in your own
code, configure it however you desire, then pass that parser instance in
to the Digester (see the Digester constructors taking a SAXParser or
XMLReader). This is much more reliable than trying to use
Digester.setSchema and related methods.

Regards,

Simon



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


RE: xsd and org.apache.commons.digester.Digester

Posted by Darren Hall <dh...@utrs.com>.
Simon,

Thanks for the response. Is there anywhere you can point me that might have
an example of how to do this. Also, is this a common issue when working with
commons digester and xsd? I'm not seeing a lot of information about it in my
Google searches.

Thanks,

Darren


-----Original Message-----
From: Simon Kitching [mailto:skitching@apache.org] 
Sent: Sunday, July 02, 2006 6:24 PM
To: Jakarta Commons Users List
Subject: RE: xsd and org.apache.commons.digester.Digester

Hi Darren,

On Fri, 2006-06-30 at 16:53 -0400, Darren Hall wrote:
> Hello again,
> 
> I fixed the earlier problem I was having with parsing my xml doc, but now
> I'm getting another one -
> 
> 2006-06-30 16:04:40,469 ERROR org.apache.commons.digester.Digester - Parse
> Error at line 2 column 13: Document is invalid: no grammar found.
> org.xml.sax.SAXParseException: Document is invalid: no grammar found.
> 
> I'm using commons-digester 1.7 and an xsd to read from my xml file.
> 
> >From the research I've been doing online, it seems this error could be
> related to the fact that I somehow need to configure the digester to let
it
> know I'm validating using XML schema... but I'm not sure.
> 
> Can anyone point me in the right direction as far as solving this problem?

Configuring validation of an xml document against a schema is
unfortunately not standardised; it varies by parser implementation. And
it is a little tricky to get right.

I therefore recommend that you create the parser instance in your own
code, configure it however you desire, then pass that parser instance in
to the Digester (see the Digester constructors taking a SAXParser or
XMLReader). This is much more reliable than trying to use
Digester.setSchema and related methods.

Regards,

Simon



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org