Sun Java Streaming XML Parser Release Notes

Implementation Version: 1.0 EA

JSR 173 Implementation

sjsxp.jar is the implementation of JSR 173.

SJSXP Features and Properties

Reporting CDATA Events

javax.xml.stream.XMLStreamReader doesn't report CDATA events. If you have an application that needs to recieve that event, configure the XMLInputFactory to set the following implementation-specific "report-cdata-event" property:

   XMLInputFactory factory = XMLInptuFactory.newInstance();
   factory.setProperty("report-cdata-event", Boolean.TRUE);

If you would like to have any new feature, please let us know at users@jwsdp.dev.java.net

JSR 173 Factories Implementation

Most applications do not need to know about the factory implementation class name. Just adding the sjsxp.jar file to the classpath is sufficient for most applications because the sjsxp.jar file supplies the factory implementation classname of different properties (javax.xml.stream.XMLInputFactory, javax.xml.stream.XMLOutputFactory<,code>, javax.xml.stream.XMLEventFactory) under the META-INF/services directory, which is the third step of a lookup operation when applications ask for the factory instance. See the javadoc of the XMLInputFactory.newInstance() method for more information about the lookup mechanism.

However, there may be scenarios when an application would like to know about the factory implementation class name and set the property explicitly. These scenarios could include cases where there are multiple JSR 173 implementations in the classpath and the application wants to choose one, perhaps one that has superior performance, contains a crucial bug fix, etc.

If an application sets the SystemProperty, it is the first step in a lookup operation, obtaining the factory instance would be fast compared to other options.

 javax.xml.stream.XMLInputFactory --> com.sun.xml.stream.ZephyrParserFactory
 javax.xml.stream.XMLOutputFactory --> com.sun.xml.stream.ZephyrWriterFactor
 javax.xml.stream.XMLEventFactory --> com.sun.xml.stream.events.ZephyrEventFactory

Known Issues

Filters

When an application creates a filtered reader object by invoking the createFilteredReader method on the InputFactory object, the filtered reader will point to the first event that is accepted by the StreamFilter or EventFilter implementation provided by the application. If none of the events is accepted, the getEventType method returns a value of "-1". The application can use hasNext or next to traverse the XML document and read the filtered events.

We are interested in your opinion of what should be the right behavior. We want to make sure that the correct behavior is specified in next version of the StAX specification.

IS_COALESCE & IS_REPLACE_ENTITY_REFERENCE Behavior

The JSR 173 specification is not clear what should the parser behavior should be when javax.xml.stream.XMLStreamConstants.IS_COALESCE is set to "true" and javax.xml.stream.XMLStreamConstants.IS_REPLACE_ENTITY_REFERENCE is set to "false". The SJSXP implementation's behavior is that 'javax.xml.stream.XMLStreamConstants.IS_COALESCE' takes precedence and the value of javax.xml.stream.XMLStreamConstants.IS_REPLACE_ENTITY_REFERENCE is ignored.

We are interested in your opinion of what the right behavior should be. We want to make sure that the correct behavior is specified in next version of the StAX specification.

Find a Bug?

If you find a bug with the SJSXP implementation, please send mail to users@jwsdp.dev.java.net and please include or describe the standalone test case showing the problem.

Questions?

Please direct any questions about SJSXP to users@jwsdp.dev.java.net.