[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Relative URI "my-report.dtd"; can not be resolved
Brad Clark wrote:
I'm using xsl/fop to generate dynamic pdf's from xml. The xml has an associated dtd which defines a number of entities. When the xml is not dynamic but is loaded from a file, which resides in the same directory as the dtd, the pdf gets generated fine. When the xml comes from a dynamic string, the dtd specified in the DOCTYPE isn't found.
I know the reason is because the transformer doesn't have a base directory to use for the relative uri. I defined a URIResolver and called setURIResolver but it never seems to call the resolve callback.
String test =... try { return new SAXSource(new InputSource(new FileReader(new File(REPORT_INPUT_BASEDIR + href))));
Exact handling of the system Id may vary a bit, maybe you'll have to adjust it so that if the DTD files are in /foo/bar/*.dtd you may have to set it to either /foo/bar, /foo/bar/ or /foo/bar/dummy or perhaps /foo/bar/existing-file.xml. Alternatively, and possibly more robust, is to use an entity resolver. J.Pietschmann XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|