Code example for SAXSource

0
			SAXParserFactory spf = SAXParserFactory.newInstance();
			spf.setFeature("http://apache.org/xml/features/validation/schema", false);
			spf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
			XMLReader xmlReader = spf.newSAXParser().getXMLReader();
			InputSource inputSource = new InputSource(inputStream);
			SAXSource source = new SAXSource(xmlReader,inputSource);
			 
			Unmarshaller u = jc.createUnmarshaller();
			JAXBElement<T> root = u.unmarshal(source,docClass);
			return root.getValue();
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE