1 package com.icl.saxon.aelfred; 2 3 import javax.xml.parsers.*; 4 import org.xml.sax.*; 5 6 12 13 public class SAXParserFactoryImpl extends SAXParserFactory { 14 15 public SAXParserFactoryImpl() { 16 setNamespaceAware(true); 17 setValidating(false); 18 }; 19 20 public boolean getFeature(String name) 21 throws SAXNotRecognizedException, SAXNotSupportedException { 22 return new SAXDriver().getFeature(name); 23 } 24 25 public void setFeature(String name, boolean value) 26 throws SAXNotRecognizedException, SAXNotSupportedException { 27 new SAXDriver().setFeature(name, value); 29 } 30 31 public SAXParser newSAXParser() 32 throws ParserConfigurationException { 33 if (isValidating()) { 34 throw new ParserConfigurationException("AElfred parser is non-validating"); 35 } 36 if (!isNamespaceAware()) { 37 throw new ParserConfigurationException("AElfred parser is namespace-aware"); 38 } 39 return new SAXParserImpl(); 40 } 41 42 } 43 44 | Popular Tags |