Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] dtd file 'into' a jar

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Peter Taylor" <peter.taylor AT greenhat.com>
  • To: "XOM API for Processing XML with Java" <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] dtd file 'into' a jar
  • Date: Sat, 29 Aug 2009 11:00:07 +0100

To do this you with need a custom:
http://java.sun.com/javase/6/docs/api/org/xml/sax/EntityResolver.html

That can then be set on:
http://java.sun.com/javase/6/docs/api/org/xml/sax/XMLReader.html
#setEntityResolver(org.xml.sax.EntityResolver)

and subsequently passed into:
http://xom.nu/apidocs/nu/xom/Builder.html
#Builder(org.xml.sax.XMLReader, boolean)

Note:
As you are probably already aware, you'll need to get the dtd from inside the
jar using the same technique as the fetching the other resources, i.e. using:
http://java.sun.com/javase/6/docs/api/java/lang/ClassLoader.html
#getResourceAsStream(java.lang.String)

Regards,
Peter T



Archive powered by MHonArc 2.6.24.

Top of Page