[ 
https://issues.apache.org/jira/browse/WSCOMMONS-562?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andreas Veithen resolved WSCOMMONS-562.
---------------------------------------

    Resolution: Won't Fix

I've added a property to OMOutputFormat that allows to set the 
StAXWriterConfiguration that will be used when MTOMXMLStreamWriter requests an 
XMLStreamWriter from StAXUtils.

However, this can't be used to eliminate the XMLStreamWriterFilter feature 
because an XMLStreamWriterFilter can be applied to part of the output document, 
while a StAXWriterConfiguration always applies to the entire document.

It's a bit unfortunate that the way XMLStreamWriterFilter is designed makes it 
difficult to reuse existing XMLStreamWriter wrappers (they would have to be 
refactored to implement the XMLStreamWriterFilter interface), but probably this 
feature will not be used very often. Another interesting aspect is that the 
XMLStreamWriterFilter thing in MTOMXMLStreamWriter is only necessary because 
MTOMXMLStreamWriter is a concrete class and not an interface. This makes it 
impossible to add a wrapper around MTOMXMLStreamWriter. This is maybe something 
that should be addressed in 1.3.

> 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.

Reply via email to