sw.flush();
sw.close();
String parser = XMLResourceDescriptor.getXMLParserClassName();
SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
SVGDocument outDoc = null;
try {
outDoc = f.createSVGDocument
(uri, new StringReader(sw.toString()));
} catch (Exception e) {
System.err.println("======================================");
System.err.println(sw.toString());
System.err.println("======================================");
throw new IllegalArgumentException
(Resources.getString(ERROR_RESULT_GENERATED_EXCEPTION));
}
// Patch the result tree to go under the root node
// checkAndPatch(outDoc);
svgViewerFrame.getJSVGCanvas().setSVGDocument((SVGDocument)outDoc);
svgViewerFrame.setSVGDocument(outDoc,
uri,
outDoc.getTitle());
}