31 import com.sun.org.apache.xerces.internal.util.MessageFormatter; |
31 import com.sun.org.apache.xerces.internal.util.MessageFormatter; |
32 import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings; |
32 import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings; |
33 import com.sun.org.apache.xerces.internal.util.PropertyState; |
33 import com.sun.org.apache.xerces.internal.util.PropertyState; |
34 import com.sun.org.apache.xerces.internal.util.SymbolTable; |
34 import com.sun.org.apache.xerces.internal.util.SymbolTable; |
35 import com.sun.org.apache.xerces.internal.utils.ObjectFactory; |
35 import com.sun.org.apache.xerces.internal.utils.ObjectFactory; |
36 import com.sun.org.apache.xerces.internal.utils.SecuritySupport; |
36 import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; |
37 import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler; |
37 import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler; |
38 import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler; |
38 import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler; |
39 import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler; |
39 import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler; |
40 import com.sun.org.apache.xerces.internal.xni.XNIException; |
40 import com.sun.org.apache.xerces.internal.xni.XNIException; |
41 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; |
41 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; |
154 |
154 |
155 /** Property identifier: Schema DV Factory */ |
155 /** Property identifier: Schema DV Factory */ |
156 protected static final String SCHEMA_DV_FACTORY = |
156 protected static final String SCHEMA_DV_FACTORY = |
157 Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY; |
157 Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY; |
158 |
158 |
159 /** Property identifier: access to external dtd */ |
159 /** Property identifier: Security property manager. */ |
160 protected static final String ACCESS_EXTERNAL_DTD = |
160 private static final String XML_SECURITY_PROPERTY_MANAGER = |
161 XMLConstants.ACCESS_EXTERNAL_DTD; |
161 Constants.XML_SECURITY_PROPERTY_MANAGER; |
162 |
|
163 /** Property identifier: access to external schema */ |
|
164 protected static final String ACCESS_EXTERNAL_SCHEMA = |
|
165 XMLConstants.ACCESS_EXTERNAL_SCHEMA; |
|
166 |
162 |
167 // |
163 // |
168 // Data |
164 // Data |
169 // |
165 // |
170 XMLDocumentHandler fDocumentHandler; |
166 XMLDocumentHandler fDocumentHandler; |
281 GRAMMAR_POOL, |
277 GRAMMAR_POOL, |
282 JAXP_SCHEMA_SOURCE, |
278 JAXP_SCHEMA_SOURCE, |
283 JAXP_SCHEMA_LANGUAGE, |
279 JAXP_SCHEMA_LANGUAGE, |
284 DTD_VALIDATOR_FACTORY_PROPERTY, |
280 DTD_VALIDATOR_FACTORY_PROPERTY, |
285 SCHEMA_DV_FACTORY, |
281 SCHEMA_DV_FACTORY, |
286 ACCESS_EXTERNAL_DTD, |
282 XML_SECURITY_PROPERTY_MANAGER |
287 ACCESS_EXTERNAL_SCHEMA |
|
288 }; |
283 }; |
289 addRecognizedProperties(recognizedProperties); |
284 addRecognizedProperties(recognizedProperties); |
290 |
285 |
291 // set default values for normalization features |
286 // set default values for normalization features |
292 features |= NAMESPACES; |
287 features |= NAMESPACES; |
316 addComponent(manager); |
311 addComponent(manager); |
317 |
312 |
318 fValidationManager = createValidationManager(); |
313 fValidationManager = createValidationManager(); |
319 setProperty(VALIDATION_MANAGER, fValidationManager); |
314 setProperty(VALIDATION_MANAGER, fValidationManager); |
320 |
315 |
321 //For DOM, the secure feature is set to true by default |
316 setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, |
322 String accessExternal = SecuritySupport.getDefaultAccessProperty( |
317 new XMLSecurityPropertyManager()); |
323 Constants.SP_ACCESS_EXTERNAL_DTD, Constants.EXTERNAL_ACCESS_DEFAULT); |
|
324 setProperty(ACCESS_EXTERNAL_DTD, accessExternal); |
|
325 |
|
326 accessExternal = SecuritySupport.getDefaultAccessProperty( |
|
327 Constants.SP_ACCESS_EXTERNAL_SCHEMA, Constants.EXTERNAL_ACCESS_DEFAULT); |
|
328 setProperty(ACCESS_EXTERNAL_SCHEMA, accessExternal); |
|
329 |
318 |
330 // add message formatters |
319 // add message formatters |
331 if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) { |
320 if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) { |
332 XMLMessageFormatter xmft = new XMLMessageFormatter(); |
321 XMLMessageFormatter xmft = new XMLMessageFormatter(); |
333 fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft); |
322 fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft); |