[jdom-interest] Storing DTD (but not XML) inside a Jar file

Per Norrman per.norrman at austers.se
Fri May 13 10:23:33 PDT 2005


Norman Elton skrev:
> Hello,
> 
> First of all, great library. Very powerful; yet simple to use. Thanks.
> 
> Second... I'm bundling my application in a Jar file. The user will  
> provide a XML config file to be parsed by JDOM. I want to validate  the 
> config file against a DTD that is bundled in the Jar file. I saw  a 
> solution using the ClassLoader to store both the XML and DTD in the  
> file, but I want the XML to be stored externally.
> 
> Is this possible? If not with JDOM, can I load/parse the file, then  
> send it through another validator?
> 
> Thanks for any advice,
> 
Possible! Just provide SAXBuilder with an EntityResolver that obtains
the DTD from the JAR file.

/pmn



More information about the jdom-interest mailing list