deweese 2003/03/13 11:29:27 Modified: resources/org/apache/batik/dom/svg/resources dtdids.properties sources/org/apache/batik/dom/svg SAXSVGDocumentFactory.java Log: Need to provide xlink and svg namespace decl on svg elements. Revision Changes Path 1.7 +17 -9 xml-batik/resources/org/apache/batik/dom/svg/resources/dtdids.properties Index: dtdids.properties =================================================================== RCS file: /home/cvs/xml-batik/resources/org/apache/batik/dom/svg/resources/dtdids.properties,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- dtdids.properties 13 Mar 2003 19:03:19 -0000 1.6 +++ dtdids.properties 13 Mar 2003 19:29:27 -0000 1.7 @@ -13,6 +13,16 @@ -//W3C//DTD SVG 1.1 Basic//EN\ -//W3C//DTD SVG 1.1 Tiny//EN +systemId.-//W3C//DTD_SVG_1.0//EN = resources/svg10.dtd +systemId.-//W3C//DTD_SVG_20010904//EN = resources/svg10.dtd +systemId.-//W3C//DTD_SVG_20001102//EN = resources/svg10.dtd +systemId.-//W3C//DTD_SVG_20000802//EN = resources/svg10.dtd +systemId.-//W3C//DTD_SVG_20000303_Stylable//EN = resources/svg10.dtd + +systemId.-//W3C//DTD_SVG_1.1//EN = resources/svg11-flat.dtd +systemId.-//W3C//DTD_SVG_1.1_Basic//EN = resources/svg11-basic-flat.dtd +systemId.-//W3C//DTD_SVG_1.1_Tiny//EN = resources/svg11-tiny-flat.dtd + # # The skippablePublicIds property represents the list of SVG DTD's we # can safely skip if we are not validating. Since SVG may move to @@ -28,12 +38,10 @@ -//W3C//DTD SVG 1.1 Basic//EN\ -//W3C//DTD SVG 1.1 Tiny//EN -systemId.-//W3C//DTD_SVG_1.0//EN = resources/svg10.dtd -systemId.-//W3C//DTD_SVG_20010904//EN = resources/svg10.dtd -systemId.-//W3C//DTD_SVG_20001102//EN = resources/svg10.dtd -systemId.-//W3C//DTD_SVG_20000802//EN = resources/svg10.dtd -systemId.-//W3C//DTD_SVG_20000303_Stylable//EN = resources/svg10.dtd - -systemId.-//W3C//DTD_SVG_1.1//EN = resources/svg11-flat.dtd -systemId.-//W3C//DTD_SVG_1.1_Basic//EN = resources/svg11-basic-flat.dtd -systemId.-//W3C//DTD_SVG_1.1_Tiny//EN = resources/svg11-tiny-flat.dtd +# +# This is an absolutely minimal DTD for SVG 1.0/1.1 +# It just defines the svg and xlink namespaces. +skipDTD = \ +<!ELEMENT svg (desc|title|metadata|defs)*> \ +<!ATTLIST svg xmlns CDATA #FIXED "http://www.w3.org/2000/svg" \ + xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink" > 1.20 +18 -5 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.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- SAXSVGDocumentFactory.java 13 Mar 2003 19:03:19 -0000 1.19 +++ SAXSVGDocumentFactory.java 13 Mar 2003 19:29:27 -0000 1.20 @@ -11,7 +11,7 @@ import java.io.InputStream; import java.io.IOException; import java.io.Reader; -import java.io.ByteArrayInputStream; +import java.io.StringReader; import java.net.MalformedURLException; import java.net.URL; @@ -57,6 +57,11 @@ public static final String KEY_SKIPPABLE_PUBLIC_IDS = "skippablePublicIds"; /** + * Key used for the skippable DTD substitution + */ + public static final String KEY_SKIP_DTD = "skipDTD"; + + /** * Key used for system identifiers */ public static final String KEY_SYSTEM_ID = "systemId."; @@ -83,6 +88,11 @@ protected static String skippable_dtdids; /** + * The DTD content to use when skipping + */ + protected static String skip_dtd; + + /** * The ResourceBunder for the public and system ids */ protected static ResourceBundle rb; @@ -316,14 +326,17 @@ if (skippable_dtdids == null) skippable_dtdids = rb.getString(KEY_SKIPPABLE_PUBLIC_IDS); + if (skip_dtd == null) + skip_dtd = rb.getString(KEY_SKIP_DTD); if (publicId != null){ if (!isValidating && (skippable_dtdids.indexOf(publicId) != -1)) { // We are not validating and this is a DTD we can - // safely skip so do it... - byte [] bytes = new byte[0]; - return new InputSource(new ByteArrayInputStream(bytes)); + // safely skip so do it... Here we provide just enough + // of the DTD to keep stuff running (set svg and + // xlink namespaces). + return new InputSource(new StringReader(skip_dtd)); } if (dtdids.indexOf(publicId) != -1) {
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]