Hitachi

uCosminexus Application Server XML Processor User Guide


6.1 Notes common to JAXP1.4 functions

The following table gives general notes on JAXP 1.4:

Table 6‒1: 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:

  • Occurrence of a RuntimeException exception, such as IllegalArgumentException

  • Occurrence of a SAXException exception

  • The operations of the XML parser are invalid

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.

Table 6‒2: Classes and methods not supported in JAXP1.4

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.

Table 6‒3: Factory-generating methods and specifiable factory class names

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

#

Supported in Developer's Kit for Java 09-60 or later

Organization of this section