6.1 Notes common to JAXP1.4 functions
The following table gives general notes on JAXP 1.4:
No. |
Notes |
---|---|
1 |
For some methods in the JAXP 1.4 specification, the behavior when an argument is set to null is not defined. Note that if you specify null for an argument of these methods, they might result in undefined behavior, including a NullPointerException. |
2 |
If an exception occurs in one of the methods defined in the JAXP 1.4 specification, applying the getMessage method to the exception object can often provide detailed messages. However, you cannot always get detailed messages. Therefore, in the application, proper processing must be executed according to the exception type instead of the exception handling dependent on the content of detailed messages. For example, in case of a DOMException, determine the detailed cause of the error by using the code field. |
3 |
Specify the correct format for URIs to be specified in the arguments of the parse(String uri) method of the DocumentBuilder class and parse(String uri, ...) method of the SAXParser class. If you specify an invalid string as URI, a RuntimeException exception, such as IllegalArgumentException might occur. |
4 |
The File object to be specified in the arguments of the parse(File f) method of the DocumentBuilder class and parse(File f, ...) method of the SAXParser class must be generated by a File constructor that does not include a percent sign (%), hash mark (#), or question mark (?) in the arguments. If you specify a File object generated by the File constructor that contains these characters in its arguments, the following phenomena might occur:
|
5 |
Unify the encoding of XML documents, encoding of the pseudo attribute of the XML declaration, and encoding of InputSource and Reader. Only operations with unified encoding are guaranteed. |
When you use JAXP1.4, you cannot use the classes and methods listed in the following table.
No. |
Package name |
Class name |
Method name |
---|---|---|---|
1 |
javax.xml.stream |
XMLEventFactory |
newInstance(String, ClassLoader) |
2 |
XMLInputFactory |
newInstance(String, ClassLoader) |
|
3 |
XMLOutputFactory |
newInstance(String, ClassLoader) |
Also, you can only specify the factory class names described in the table for the methods listed in the following table. The operations might not function normally, if other factory class names are specified.
No. |
Package name |
Class name |
Method name |
Specifiable factory class name |
---|---|---|---|---|
1 |
javax.xml.datatype |
DatatypeFactory |
newInstance(String, ClassLoader) |
com.cosminexus.jaxp.impl.parsers.jaxp.datatype.DatatypeFactoryImp |
2 |
javax.xml.parsers |
DocumentBuilderFactory |
newInstance(String, ClassLoader) |
com.cosminexus.jaxp.impl.parsers.jaxp.DocumentBuilderFactoryImpl |
3 |
SAXParserFactory |
newInstance(String, ClassLoader) |
com.cosminexus.jaxp.impl.parsers.jaxp.SAXParserFactoryImpl |
|
4 |
javax.xml.stream |
XMLEventFactory |
newFactory(String, ClassLoader) |
com.cosminexus.stax.xml.stream.events.ZephyrEventFactory |
5 |
javax.xml.stream.XMLEventFactory# |
|||
6 |
XMLInputFactory |
newFactory(String, ClassLoader) |
com.cosminexus.stax.xml.stream.ZephyrParserFactory |
|
7 |
javax.xml.stream.XMLInputFactory# |
|||
8 |
XMLOutputFactory |
newFactory(String, ClassLoader) |
com.cosminexus.stax.xml.stream.ZephyrWriterFactory |
|
9 |
javax.xml.stream.XMLOutputFactory# |
|||
10 |
javax.xml.transform |
TransformerFactory |
newInstance(String, ClassLoader) |
com.cosminexus.jaxp.impl.transform.processor.TransformerFactoryImpl |
11 |
javax.xml.validation |
SchemaFactory |
newInstance(String, String, ClassLoader) |
com.cosminexus.jaxp.impl.parsers.jaxp.validation.XMLSchemaFactory |
12 |
javax.xml.xpath |
XPathFactory |
newInstance(String, String, ClassLoader) |
com.cosminexus.jaxp.impl.xpath.jaxp.XPathFactoryImpl |