1 17 18 19 20 package org.apache.fop.svg; 21 22 import java.io.IOException ; 23 24 import org.xml.sax.EntityResolver ; 25 import org.xml.sax.InputSource ; 26 import org.xml.sax.SAXException ; 27 28 import org.apache.batik.dom.svg.SAXSVGDocumentFactory; 29 30 33 public class FOPSAXSVGDocumentFactory extends SAXSVGDocumentFactory { 34 35 private EntityResolver additionalResolver; 36 37 41 public FOPSAXSVGDocumentFactory(String parser) { 42 super(parser); 43 } 44 45 50 public void setAdditionalEntityResolver(EntityResolver resolver) { 51 this.additionalResolver = resolver; 52 } 53 54 57 public InputSource resolveEntity(String publicId, String systemId) 58 throws SAXException { 59 if (this.additionalResolver != null) { 60 try { 61 InputSource result = this.additionalResolver.resolveEntity(publicId, systemId); 62 if (result != null) { 63 return result; 64 } 65 } catch (IOException ioe) { 66 68 throw new SAXException (ioe); 69 } 70 } 71 return super.resolveEntity(publicId, systemId); 72 } 73 74 } 75 | Popular Tags |