xerces-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Clark <an...@apache.org>
Subject Re: load-external-dtd?
Date Fri, 11 May 2001 02:16:21 GMT
Jason Rizer wrote:
> Unfortunately, I'm constrained to version 1.2.1 :(
> Does anyone have a work around for this problem using
> 1.2.1?  Any help would be greatly appreciated!

parser.setEntityResolver(new EntityResolver() {
  public InputSource resolveEntity(String pubId, String sysId)
    throws SAXException, IOException {
    if (sysId.endsWith(".dtd")) {
      Reader reader = new StringReader("");
      InputSource source = new InputSource(reader);
      source.setPublicId(pubId);
      source.setSystemId(sysId);
      return source;
    }
    return null;
  }
});

Note: I didn't check the code for errors.

-- 
Andy Clark * IBM, TRL - Japan * andyc@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Mime
View raw message