[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Passing external URL for DTD reference
Pramodh Peddi wrote:
Probably yes.<!DOCTYPE EXAMPLE_DTD SYSTEM "xxx.dtd"> is there in the source xml. And xxx.dtd is at http://myserver.com/xsl/xxx.dtd (the file name in the url can be different - it can be named as yyy.dtd!). Can I know how to make the transformer look at this url? I was passing in this URL to the StreamSource constructor - like new StreamSource(new StringReader(stylesheetStream),this.dtdURL)
Can we achieve this in any other way? I was trying to use EntityResolver
public class MyResolver implements EntityResolver { public InputSource resolveEntity (String publicId, String systemId) { if (systemId.equals("xxx.dtd")) { // return a special input source MyReader reader = new MyReader(); return new InputSource(http://myserver.com/xsl/xxx.dtd); } else { // use the default behaviour return null; } } } Yes. However, the entity resolver will be invoked for every entity, and some processors will it also invoke for the main input source. Therefore, the default should be return new InputSource(systemId); instead of returning null. 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
|