Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
xml
xml
<bean id="transformFeature" class="org.apache.cxf.feature.StaxTransformFeature">
  <property name="inAppendElements">
    <map>
      <!-- append new simple "thebook" element with a text value '2' before "the "book" element -->
      <entry key="book" value="thebook=2"/>
    </map>
  </property>
</bean> 

...

Code Block
xml
xml
<bean id="transformFeature" class="org.apache.cxf.feature.StaxTransformFeature">
  <property name="inAppendElements">
    <map>
      <!-- append new simple "thebook" element with a text value '2' afterusing the "/" convention as the book", using a '/' convention last child element within the "book" element -->
      <entry key="book/" value="thebook=2"/>
    </map>
  </property>
</bean> 
 

Comparing four append modes

 
input

append-pre-wrap

 

append-post-wrapappend-pre-includeappend-post-include
 key="book" value="thebook"key="book/" value="thebook"key="book" value="thebook=2"key="book/" value="thebook=2"
<sales>
<book>
<title>CXF ...</title>
<price>38.68</price>
</book>
</sales>
<sales>
<thebook>
<book>
<title>CXF ...</title>
<price>38.68</price>
</book>
</thebook>
</sales>
<sales>
<book>
<thebook>
<title>CXF ...</title>
<price>38.68</price>
</thebook>
</book>
</sales>
<sales>
<thebook>2</thebook>
<book>
<title>CXF ...</title>
<price>38.68</price>
</book>
</sales>
<sales>
<book>
<title>CXF ...</title>
<price>38.68</price>
<thebook>2</thebook>
</book>
</sales>

Replacing text content

It's possible to replace the text content of a given simple element only on the input and output, for example:

...