commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniela Pistelli Gomes" <dani...@summa-tech.com>
Subject Validator/Digester offline validation
Date Fri, 02 Apr 2004 20:41:39 GMT
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
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message