public SVGImageProcessor(InputStream svg, boolean mapById) { try { String parser = XMLResourceDescriptor.getXMLParserClassName(); SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(parser); factory.setValidating(false); Document svgDocument = factory.createDocument("http://jbpm.org", svg); svgProcessor = new SVGProcessorFactory().create(svgDocument, mapById); svgProcessor.processNodes(svgDocument.getChildNodes()); } catch (IOException e) { throw new RuntimeException("Could not parse svg", e); } }
private Document readSVG(String svgContent) throws IOException { String parser = XMLResourceDescriptor.getXMLParserClassName(); SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(parser); factory.setValidating(false); Document svgDocument = factory.createDocument("http://jbpm.org", new StringReader(svgContent)); return svgDocument; } }
private Document readSVG(String svgContent) throws IOException { String parser = XMLResourceDescriptor.getXMLParserClassName(); SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(parser); factory.setValidating(false); Document svgDocument = factory.createDocument("http://jbpm.org", new StringReader(svgContent)); return svgDocument; } }
f.setValidating(validate); Document doc = null;