/** * @see org.apache.xerces.xni.parser.XMLParserConfiguration#setFeature(java.lang.String, boolean) */ @Override public void setFeature(String featureId, boolean state) throws XMLConfigurationException { config.setFeature(featureId, state); }
/** * Delegates to SchemaParsingConfig.setFeature * @param featureId * @param state */ public void setFeature(String featureId, boolean state){ config.setFeature(featureId, state); }
fConfiguration.setFeature (DEFER_NODE_EXPANSION, false); fConfiguration.setFeature(Constants.DOM_NAMESPACE_DECLARATIONS, true); fConfiguration.setFeature(Constants.DOM_WELLFORMED, true); fConfiguration.setFeature(INCLUDE_COMMENTS_FEATURE, true); fConfiguration.setFeature(INCLUDE_IGNORABLE_WHITESPACE, true); fConfiguration.setFeature(NAMESPACES, true); fConfiguration.setFeature(DYNAMIC_VALIDATION, false); fConfiguration.setFeature(CREATE_ENTITY_REF_NODES, false); fConfiguration.setFeature(CREATE_CDATA_NODES_FEATURE, false); fConfiguration.setFeature (Constants.DOM_CANONICAL_FORM, false); fConfiguration.setFeature (Constants.DOM_CHARSET_OVERRIDES_XML_ENCODING, true); fConfiguration.setFeature (Constants.DOM_SPLIT_CDATA, true); fConfiguration.setFeature (Constants.DOM_SUPPORTED_MEDIATYPES_ONLY, false); fConfiguration.setFeature (Constants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS, true); fConfiguration.setFeature (Constants.DOM_CERTIFIED, true); fConfiguration.setFeature ( NORMALIZE_DATA, false );
/** Default constructor. */ protected AbstractDOMParser (XMLParserConfiguration config) { super (config); // add recognized features fConfiguration.addRecognizedFeatures (RECOGNIZED_FEATURES); // set default values fConfiguration.setFeature (CREATE_ENTITY_REF_NODES, true); fConfiguration.setFeature (INCLUDE_IGNORABLE_WHITESPACE, true); fConfiguration.setFeature (DEFER_NODE_EXPANSION, true); fConfiguration.setFeature (INCLUDE_COMMENTS_FEATURE, true); fConfiguration.setFeature (CREATE_CDATA_NODES_FEATURE, true); // add recognized properties fConfiguration.addRecognizedProperties (RECOGNIZED_PROPERTIES); // set default values fConfiguration.setProperty (DOCUMENT_CLASS_NAME, DEFAULT_DOCUMENT_CLASS_NAME); } // <init>(XMLParserConfiguration)
private static XMLParserConfiguration createValidatingParser( XMLEntityResolver entityResolver, GrammarPool grammarPool ) throws XNIException { XMLParserConfiguration parserConfiguration = null; if ( grammarPool == null ) { parserConfiguration = new XIncludeAwareParserConfiguration(); } else { parserConfiguration = new XIncludeAwareParserConfiguration( grammarPool.getSymbolTable(), grammarPool ); } parserConfiguration.setFeature( NAMESPACES_FEATURE_ID, true ); parserConfiguration.setFeature( VALIDATION_FEATURE_ID, true ); parserConfiguration.setFeature( SCHEMA_VALIDATION_FEATURE_ID, true ); parserConfiguration.setFeature( SCHEMA_FULL_CHECKING_FEATURE_ID, true ); // NOTE: don't set to true, or validation of WFS GetFeature responses will fail (Xerces error?)! parserConfiguration.setFeature( HONOUR_ALL_SCHEMA_LOCATIONS_ID, false ); if ( entityResolver != null ) { parserConfiguration.setEntityResolver( entityResolver ); } return parserConfiguration; } }
private void copyFeatures1( Enumeration features, String featurePrefix, XMLComponentManager from, XMLParserConfiguration to) { while (features.hasMoreElements()) { String featureId = featurePrefix + (String)features.nextElement(); boolean value = from.getFeature(featureId); try { to.setFeature(featureId, value); } catch (XMLConfigurationException e) { // componentManager doesn't support this feature, // so we won't worry about it } } }
/** Default constructor. */ protected AbstractSAXParser(XMLParserConfiguration config) { super(config); config.addRecognizedFeatures(RECOGNIZED_FEATURES); config.addRecognizedProperties(RECOGNIZED_PROPERTIES); try { config.setFeature(ALLOW_UE_AND_NOTATION_EVENTS, false); } catch (XMLConfigurationException e) { // it wasn't a recognized feature, so we don't worry about it } } // <init>(XMLParserConfiguration)
parser.setFeature(NOTIFY_CHAR_REFS, true); parser.setFeature(NOTIFY_HTML_BUILTIN_REFS, true); String iencoding = null; String oencoding = "Windows-1252";
/** Default constructor. */ public DOMFragmentParser() { fParserConfiguration = new HTMLConfiguration(); fParserConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES); fParserConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES); fParserConfiguration.setFeature(DOCUMENT_FRAGMENT, true); fParserConfiguration.setDocumentHandler(this); }
/** Default constructor. */ public DOMFragmentParser() { fParserConfiguration = new HTMLConfiguration(); fParserConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES); fParserConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES); fParserConfiguration.setFeature(DOCUMENT_FRAGMENT, true); fParserConfiguration.setDocumentHandler(this); } // <init>()
/** * Default constructor. */ public DOMFragmentParser() { fParserConfiguration = new HTMLConfiguration(); fParserConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES); fParserConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES); fParserConfiguration.setFeature(DOCUMENT_FRAGMENT, true); fParserConfiguration.setDocumentHandler(this); } // <init>()
/** Default constructor. */ public DOMFragmentParser() { fParserConfiguration = new HTMLConfiguration(); fParserConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES); fParserConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES); fParserConfiguration.setFeature(DOCUMENT_FRAGMENT, true); fParserConfiguration.setDocumentHandler(this); } // <init>()
/** * Default constructor. */ public DOMFragmentParser() { fParserConfiguration = new HTMLConfiguration(); fParserConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES); fParserConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES); fParserConfiguration.setFeature(DOCUMENT_FRAGMENT, true); fParserConfiguration.setDocumentHandler(this); } // <init>()
/** * Set the state of any feature in a SAX2 parser. The parser might not recognize the feature, and * if it does recognize it, it might not be able to fulfill the request. * * @param featureId The unique identifier (URI) of the feature. * @param state The requested state of the feature (true or false). * @throws SAXNotRecognizedException If the requested feature is not known. * @throws SAXNotSupportedException If the requested feature is known, but the requested state * is not supported. */ public void setFeature(String featureId, boolean state) throws SAXNotRecognizedException, SAXNotSupportedException { try { fParserConfiguration.setFeature(featureId, state); } catch (XMLConfigurationException e) { String message = e.getMessage(); if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) { throw new SAXNotRecognizedException(message); } else { throw new SAXNotSupportedException(message); } } } // setFeature(String,boolean)
/** * Set the state of any feature in a SAX2 parser. The parser might not recognize the feature, and * if it does recognize it, it might not be able to fulfill the request. * * @param featureId The unique identifier (URI) of the feature. * @param state The requested state of the feature (true or false). * @throws SAXNotRecognizedException If the requested feature is not known. * @throws SAXNotSupportedException If the requested feature is known, but the requested state * is not supported. */ public void setFeature(String featureId, boolean state) throws SAXNotRecognizedException, SAXNotSupportedException { try { fParserConfiguration.setFeature(featureId, state); } catch (XMLConfigurationException e) { String message = e.getMessage(); if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) { throw new SAXNotRecognizedException(message); } else { throw new SAXNotSupportedException(message); } } } // setFeature(String,boolean)
/** * Set the state of any feature in a SAX2 parser. The parser * might not recognize the feature, and if it does recognize * it, it might not be able to fulfill the request. * * @param featureId The unique identifier (URI) of the feature. * @param state The requested state of the feature (true or false). * * @exception SAXNotRecognizedException If the * requested feature is not known. * @exception SAXNotSupportedException If the * requested feature is known, but the requested * state is not supported. */ public void setFeature(String featureId, boolean state) throws SAXNotRecognizedException, SAXNotSupportedException { try { fParserConfiguration.setFeature(featureId, state); } catch (XMLConfigurationException e) { String message = e.getMessage(); if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) { throw new SAXNotRecognizedException(message); } throw new SAXNotSupportedException(message); } } // setFeature(String,boolean)
/** * Set the state of any feature in a SAX2 parser. The parser * might not recognize the feature, and if it does recognize * it, it might not be able to fulfill the request. * * @param featureId The unique identifier (URI) of the feature. * @param state The requested state of the feature (true or false). * * @exception SAXNotRecognizedException If the * requested feature is not known. * @exception SAXNotSupportedException If the * requested feature is known, but the requested * state is not supported. */ public void setFeature(String featureId, boolean state) throws SAXNotRecognizedException, SAXNotSupportedException { try { fParserConfiguration.setFeature(featureId, state); } catch (final XMLConfigurationException e) { final String message = e.getMessage(); if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) { throw new SAXNotRecognizedException(message); } throw new SAXNotSupportedException(message); } }
/** * Set the state of any feature in a SAX2 parser. The parser * might not recognize the feature, and if it does recognize * it, it might not be able to fulfill the request. * * @param featureId The unique identifier (URI) of the feature. * @param state The requested state of the feature (true or false). * * @exception SAXNotRecognizedException If the * requested feature is not known. * @exception SAXNotSupportedException If the * requested feature is known, but the requested * state is not supported. */ public void setFeature(String featureId, boolean state) throws SAXNotRecognizedException, SAXNotSupportedException { try { fParserConfiguration.setFeature(featureId, state); } catch (XMLConfigurationException e) { String message = e.getMessage(); if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) { throw new SAXNotRecognizedException(message); } else { throw new SAXNotSupportedException(message); } } } // setFeature(String,boolean)
/** * Constructs a SAX parser using the specified symbol table and * grammar pool. */ public SAXParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) { super((XMLParserConfiguration)ObjectFactory.createObject( "org.apache.xerces.xni.parser.XMLParserConfiguration", "org.apache.xerces.parsers.XIncludeAwareParserConfiguration" )); // set features fConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES); fConfiguration.setFeature(NOTIFY_BUILTIN_REFS, true); // set properties fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES); if (symbolTable != null) { fConfiguration.setProperty(SYMBOL_TABLE, symbolTable); } if (grammarPool != null) { fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool); } } // <init>(SymbolTable,XMLGrammarPool)
fConfiguration.setFeature(featureId, state);