commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank W. Zammetti" <fzli...@omnytex.com>
Subject [Digester] Unable to get validation working
Date Mon, 25 Apr 2005 20:29:23 GMT
Hey all... I'm trying to use validation with Digester for the first time
and not having any luck.

In my code, I have this:

digester.setValidating(true);
digester.register("myconfig",
this.getClass().getResource("my-config.dtd").toString());

That second line throws an NPE.  The my-config.dtd is in WEB-INF.  In my
XML file to be parsed and validated I have:

<!DOCTYPE myconfig SYSTEM "WEB-INF/my-config.dtd">

I should point out that when I remove those two lines my config file is
parsed properly, so I know it's choking on the DTD...

I can only assume the DTD is not being found (no error messages other than
an NPE displayed, logging is set to log everything to the console).  I've
tried various paths in the getResource call including
"WEB-INF/my-config.dtd", "/WEB-INF/my-config.dtd" and of course just the
filename as above.  I pretty much assume I'm just not using Digester right
as far as validation goes, so can someone point me in the right direction?
 Thanks in advance.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

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


Mime
View raw message