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

Norman Elton normelton at gmail.com
Fri May 13 10:40:48 PDT 2005


Thank you! That's exactly what I was looking for.

Norman

On May 13, 2005, at 1:23 PM, Per Norrman wrote:

> 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