src/main/java/com/mxgraph/reader/mxGraphViewImageReader.java
public static BufferedImage convert(InputSource inputSource,
			mxGraphViewImageReader viewReader)
			throws ParserConfigurationException, SAXException, IOException
	{
		BufferedImage result = null;
		
		XMLReader reader = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
		reader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
		reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
		reader.setFeature("http://xml.org/sax/features/external-general-entities", false);
		reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
		
		reader.setContentHandler(viewReader);
		reader.parse(inputSource);

		if (viewReader.getCanvas() instanceof mxImageCanvas)
		{
			result = ((mxImageCanvas) viewReader.getCanvas()).destroy();
		}

		return result;
	}
/**
	 * Creates the image for the given display XML input source. (Note: The XML
	 * is an encoded mxGraphView, not mxGraphModel.)
	 * 
	 * @param inputSource
	 *            Input source that contains the display XML.
	 * @return Returns an image representing the display XML input source.
	 */
Creates the image for the given display XML input source. (Note: The XML
is an encoded mxGraphView, not mxGraphModel.)

@param inputSource
Input source that contains the display XML.
@return Returns an image representing the display XML input source.
Creates the image for the given display XML input source . ( Note : The XML is an encoded mxGraphView not mxGraphModel . ) @param inputSource Input source that contains the display XML . @return Returns an image representing the display XML input source .
public static BufferedImage convert(InputSource inputSource,
			mxGraphViewImageReader viewReader)
			throws ParserConfigurationException, SAXException, IOException
	{
		BufferedImage result = null;
		XMLReader reader = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
		reader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
		reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
		reader.setFeature("http://xml.org/sax/features/external-general-entities", false);
		reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
		reader.setContentHandler(viewReader);
		reader.parse(inputSource);
		if (viewReader.getCanvas() instanceof mxImageCanvas)
		{
			result = ((mxImageCanvas) viewReader.getCanvas()).destroy();
		}
		return result;
	}
public static BufferedImage convert ( InputSource inputSource , mxGraphViewImageReader viewReader ) throws ParserConfigurationException , SAXException , IOException { BufferedImage result = null ; XMLReader reader = SAXParserFactory . newInstance ( ) . newSAXParser ( ) . getXMLReader ( ) ; reader . setFeature ( "http://apache.org/xml/features/disallow-doctype-decl" , true ) ; reader . setFeature ( "http://apache.org/xml/features/nonvalidating/load-external-dtd" , false ) ; reader . setFeature ( "http://xml.org/sax/features/external-general-entities" , false ) ; reader . setFeature ( "http://xml.org/sax/features/external-parameter-entities" , false ) ; reader . setContentHandler ( viewReader ) ; reader . parse ( inputSource ) ; if ( viewReader . getCanvas ( ) instanceof mxImageCanvas ) { result = ( ( mxImageCanvas ) viewReader . getCanvas ( ) ) . destroy ( ) ; } return result ; }
Creates the image for the given display XML input source.
Creates the image for the given display XML input source .