vhardy 2002/11/12 04:32:06 Modified: sources/org/apache/batik/dom/svg SAXSVGDocumentFactory.java Log: Now support arbitrary public ids / system ids. This file was missing from previous commit Revision Changes Path 1.18 +27 -7 xml-batik/sources/org/apache/batik/dom/svg/SAXSVGDocumentFactory.java Index: SAXSVGDocumentFactory.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/svg/SAXSVGDocumentFactory.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- SAXSVGDocumentFactory.java 24 Jul 2002 11:50:25 -0000 1.17 +++ SAXSVGDocumentFactory.java 12 Nov 2002 12:32:06 -0000 1.18 @@ -46,6 +46,16 @@ implements SVGDocumentFactory { /** + * Key used for public identifiers + */ + public static final String KEY_PUBLIC_IDS = "publicIds"; + + /** + * Key used for system identifiers + */ + public static final String KEY_SYSTEM_ID = "systemId."; + + /** * The dtd public IDs resource bundle class name. */ protected final static String DTDIDS = @@ -62,6 +72,11 @@ protected static String dtdids; /** + * The ResourceBunder for the public and system ids + */ + protected static ResourceBundle rb; + + /** * Creates a new SVGDocumentFactory object. * @param parser The SAX2 parser classname. */ @@ -283,15 +298,20 @@ throws SAXException { try { if (dtdids == null) { - ResourceBundle rb; rb = ResourceBundle.getBundle(DTDIDS, Locale.getDefault()); - dtdids = rb.getString("publicIds"); + dtdids = rb.getString(KEY_PUBLIC_IDS); } - if (publicId != null && dtdids.indexOf(publicId) != -1) { - return new InputSource - (getClass().getResource - ("resources/svg10.dtd").toString()); + if (publicId != null){ + if (dtdids.indexOf(publicId) != -1) { + String localSystemId = + rb.getString(KEY_SYSTEM_ID + publicId.replace(' ', '_')); + + if (localSystemId != null && !"".equals(localSystemId)){ + return new InputSource + (getClass().getResource(localSystemId).toString()); + } + } } } catch (MissingResourceException e) { throw new SAXException(e);
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]