Document doc = super.createDocument
(SVGDOMImplementation.SVG_NAMESPACE_URI, "svg", uri, isrc);
try {
((SVGOMDocument)doc).setURLObject(new URL(purl.toString()));
AbstractDocument d = (AbstractDocument) doc;
d.setDocumentURI(purl.toString());
d.setDocumentInputEncoding(charset);
d.setXmlStandalone(isStandalone);
d.setXmlVersion(xmlVersion);
} catch (MalformedURLException mue) {
// Not very likely to happen given we already opened the stream.
throw new IOException("Malformed URL: " + uri);
}