commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "rleland@apache.org" <lel...@speakeasy.net>
Subject Re: Validator/Digester offline validation
Date Fri, 02 Apr 2004 21:09:16 GMT

If you use the ValidatorResources(InputStream is) instead of ValidatorResourcesInitializer(),
 to read in the validator files, your Validator.xml will be validated for you.


-Rob


> -----Original Message-----
> From: Daniela Pistelli Gomes [mailto:daniela@summa-tech.com]
> Sent: Friday, April 2, 2004 08:41 PM
> To: commons-dev@jakarta.apache.org
> Subject: Validator/Digester offline validation 
> 
> Hi,
> 
>     I'm using commons-validator and commons-digester and I need to validate the validation.xml
file
> without internet access and I don't want to remove the doctye tag.
>   I knew that I can implement any EntityResolver and set this at Digester, but I don't
have any Digester
> instance, my question is, how can I get any Digester instance (or if is possible set
the EntityResolver 
> by a Digest static method) and them set this Digest for Validator.
> 
>   At my Validator class I have
> 
>   private ValidatorResources initResources() throws IOException, SAXException {
>       final InputStream rules = Thread.currentThread().getContextClassLoader()
>                                     .getResourceAsStream("validator-rules.xml");
>       final InputStream is = Thread.currentThread().getContextClassLoader()
>                                        .getResourceAsStream("validation.xml");
>       
>       try {
>          return new ValidatorResources(new InputStream[] {rules, is});
>       } finally {
>          if (rules != null) {
>             rules.close();
>          }
> 
>          if (is != null) {
>             is.close();
>          }
>       }
>    }
> 
> Thanks for your support
> 
> Best Regards
> Daniela



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


Mime
View raw message