Skip to content

Commit

Permalink
Gracefully handle old XML parsers on SVG creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
eseifert committed Jan 17, 2016
1 parent d2559b3 commit a607d3b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ public SVGDocument(PageSize pageSize) {
DOMImplementation domImpl = docBuilder.getDOMImplementation();
DocumentType docType = domImpl.createDocumentType(SVG_DOCTYPE_QNAME, SVG_DOCTYPE_PUBLIC_ID, SVG_DOCTYPE_SYSTEM_ID);
doc = domImpl.createDocument(SVG_NAMESPACE_URI, "svg", docType);
doc.setXmlStandalone(false);
// FIXME: Some XML parsers don't support setting standalone to "false"
try {
doc.setXmlStandalone(false);
} catch (AbstractMethodError e) {
System.err.println("Your XML parser does not support standalone XML documents.");
}

root = doc.getDocumentElement();
initRoot();
Expand Down

0 comments on commit a607d3b

Please sign in to comment.