Skip to content

Commit

Permalink
The version attribute isn't part of SVG anymore, just check for 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosame committed Jun 25, 2024
1 parent 7a0fbea commit ec7dc3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "'");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1979,7 +1979,7 @@ public List<BridgeExtension> 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();
Expand Down

0 comments on commit ec7dc3d

Please sign in to comment.