Code example for SAXParserFactory

Methods: setFeaturesetNamespaceAwaresetValidating

0
	private CmsEntityDeserialization(){ 
		try{ 
			 
			saxParserFactory = SAXParserFactory.newInstance();
			 
			saxParserFactory.setNamespaceAware(true);
			saxParserFactory.setValidating(false);
			 
			saxParserFactory.setFeature("http://apache.org/xml/features/validation/schema",true);
			saxParserFactory.setFeature("http://xml.org/sax/features/validation", true);
			saxParserFactory.setFeature("http://xml.org/sax/features/namespaces",true);
			//saxParserFactory.setFeature("http://xml.org/sax/features/namespace-prefixes", true); 
			 
			/* 
			 *  
			 * A true value for this feature allows the encoding of the file to be specified as a  
			 * Java encoding name as well as the standard ISO encoding name. Be aware that other  
			 * parsers may not be able to use Java encoding names. If this feature is set to false,  
			 * an error will be generated if Java encoding names are used.   
			 */ 
			saxParserFactory.setFeature("http://apache.org/xml/features/allow-java-encodings",true);
 
		} 
		catch(Exception e){
			logger.error("",e);
		} 
Stop searching for code, let great code find you!  Add Codota to your java IDE