converted to 1.6 markup
|Deletions are marked like this.||Additions are marked like this.|
|Line 25:||Line 25:|
|Line 36:||Line 36:|
This is a proposal for a Streaming API that the AXIOM implementation can use. The java source files are available in the scratch area here:
Mainly it has two interfaces. They are
This is the streaming API, to be used by AXIOM implementation. It extends from two interfaces. i.e.
- javax.xml.stream.XMLStreamReader (StAX)
org.apache.axis.xml.ContentComparable – This interface provides methods to compare the local names, prefixes and the attribute values with given String objects, without creating unnecessary String objects.
And the TypedXMLStreamReader has some more methods to access the xml content as java typed values. (Without creating unnecessary, intermediary immutable String objects) i.e. You can retrieve a xsd typed value as the appropriate java typed value. (e.g. xsd:int -> java:int, xsd:Base64 -> java:byte, etc.,)
The TypedXMLStreamReader API can be used by the Deserializer. See the diagram below.
The OM Builder can use the javax.xml.stream.XMLStreamReader (standard StAX API) since it needs only Strings to create DOM like objects.
This is the xml push API, to be used by AXIOM implementation. It extends from javax.xml.stream.XMLStreamWriter interface. Similar to the above case the TypedXMLStreamWriter also has a set of methods to serialize java typed values as their appropriate xsd counterparts. (Without creating unnecessary, intermediary immutable String objects)
This can be used as the Stream Writer. See the diagram below.
We can implement a native implementation of the above interfaces and keep it as default. For that implementation we can use lxpp, which is an opensource implementation of lk.opensource.xml.parsers.TypedXMLPullParser and its components. (cvs.opensource.lk/lxpp)
And also we can write a general wrapper which can wrap any of the StAX implementation and provide the above API.