Refactor OMOutputFormat to use StAXWriterConfiguration instead of
XMLStreamWriterFilter
---------------------------------------------------------------------------------------
Key: WSCOMMONS-562
URL: https://issues.apache.org/jira/browse/WSCOMMONS-562
Project: WS-Commons
Issue Type: Improvement
Components: AXIOM
Reporter: Andreas Veithen
Assignee: Andreas Veithen
Fix For: Axiom 1.2.10
The current trunk contains a change that adds a property to OMOutputFormat that
allows to set an XMLStreamWriterFilter in order to have more control over the
output produced by MTOMXMLStreamWriter. Currently, only a single implementation
of XMLStreamWriterFilter exists, namely XMLStreamWriterRemoveIllegalChars. This
was done to solve AXIS2-4791.
This should be refactored to use the new StAXWriterConfiguration API (which is
the companion of the StAXParserConfiguration API introduced in 1.2.9 and which
currently only exists in trunk). Reasons:
1. As the name implies, the purpose of XMLStreamWriterRemoveIllegalChars is to
remove illegal characters in text nodes and attributes during serialization. It
is possible that some StAX implementations support this using vendor specific
factory properties. The current implementation would be unable to leverage
this. On the other hand, StAXParserConfiguration gives access to the
XMLOutputFactory and the StAXDialect, so that vendor specific extensions could
be used (while falling back to a simple XMLStreamWriter wrapper by default).
2. StAXWriterConfiguration will be the recommended way to configure low level
aspects of the XML serialization process (in particular to set XMLOutputFactory
properties). For this API to be complete, OMOutputFormat must be enhanced to
allow setting a non default StAXWriterConfiguration (otherwise the feature
would not be usable with the OMContainer#serialize methods). If the
xmlStreamWriterFilter property is preserved, then there would be two redundant
ways to do things. Therefore, xmlStreamWriterFilter should be abandoned since
StAXWriterConfiguration is more general.
Since the XMLStreamWriterFilter feature currently only exists in trunk, the
refactoring should be included in 1.2.10 in order to avoid incompatible changes
in subsequent releases.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.