diff --git a/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SAXSVGDocumentFactory.java b/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SAXSVGDocumentFactory.java index 2dc32a6a0..981db3fe4 100644 --- a/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SAXSVGDocumentFactory.java +++ b/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SAXSVGDocumentFactory.java @@ -348,12 +348,11 @@ public SVGDocument createDocument(String ns, String root, String uri, Reader r) @Override public DOMImplementation getDOMImplementation(String ver) { - if (ver == null || ver.length() == 0 || ver.equals("1.0") || ver.equals("1.1")) { + if (!"1.2".equals(ver)) { return SVGDOMImplementation.getDOMImplementation(); - } else if (ver.equals("1.2")) { + } else { return SVG12DOMImplementation.getDOMImplementation(); } - throw new RuntimeException("Unsupport SVG version '" + ver + "'"); } /** diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/BridgeContext.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/BridgeContext.java index f7d5d14fb..7dd360ff7 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/BridgeContext.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/BridgeContext.java @@ -1979,7 +1979,7 @@ public List getBridgeExtensions(Document doc) { Element root = ((SVGOMDocument) doc).getRootElement(); String ver = root.getAttributeNS(null, SVGConstants.SVG_VERSION_ATTRIBUTE); BridgeExtension svgBE; - if ((ver.length() == 0) || ver.equals("1.0") || ver.equals("1.1")) + if (!"1.2".equals(ver)) svgBE = new SVGBridgeExtension(); else svgBE = new SVG12BridgeExtension();