TransformationFeaturePage added by Sergey BeryozkinThe CXF Transformation feature provides for a flexible and fast way to do the dynamic transformations of the inbound and/or outbound XML messages. This feature can be used in a number of cases: dropping the namespace of the outbound messages, qualifying the incoming message, changing namespaces, appending or dropping elements and converting attributes to elements. The following configuration properties have been added to the base JAXB/JSON AbstractJAXBProvider :
<bean id="transformFeature" class="org.apache.cxf.feature.StaxTransfromFeature"> <property name="outTransformElements"> <map> <!-- change "book" to "thebook" --> <entry key="book" value="thebook"/> <!-- drop the namespace from "book" --> <entry key="{http://books}book" value="book"/> <!-- qualify "book" with "http://books" --> <entry key="book" value="{http://books}thebook"/> <!-- change namespace to "http://books" for all the elements with the "http://book" namespace --> <entry key="{http://book}*" value="{http://books}*"/> </map> </property> </bean>
<bean id="transformFeature" class="org.apache.cxf.feature.StaxTransfromFeature"> <property name="outAppendElements"> <map> <!-- append "book" before "thebook" --> <entry key="book" value="thebook"/> <!-- qualify "book" with "http://books" --> <entry key="{http://books}book" value="book"/> <!-- drop the namespace from the "book" --> <entry key="book" value="{http://books}thebook"/> <!-- change namespace to "http://book" for all the elements with the "http://books" namespace --> <entry key="{http://book}*" value="{http://books}*"/> </map> </property> </bean>
<bean id="transformFeature" class="org.apache.cxf.feature.StaxTransfromFeature"> <property name="outDropElements"> <list> <!-- ignore drop and {http://numbers}number elements --> <value>{http://numbers}number</value> <value>index</value> </list> </property> </bean>
The combination of "attributesAsElements" and "outDropElements" properties can be used to have certain attributes ignored in the output by turning then into elements first and then blocking them.
Change Notification Preferences
View Online
|
Add Comment
|
- [CONF] Apache CXF Documentation > TransformationFeature confluence
- [CONF] Apache CXF Documentation > TransformationFeature confluence
- [CONF] Apache CXF Documentation > TransformationFeature confluence
- [CONF] Apache CXF Documentation > TransformationFeature confluence
- [CONF] Apache CXF Documentation > TransformationFeature confluence
- [CONF] Apache CXF Documentation > TransformationFeature confluence
- [CONF] Apache CXF Documentation > TransformationFeature confluence