+49 228 5552576-0




The xmlContentFilter removes certain XML elements from message bodies. The elements are described using an XPath expression.

Can be used in

spring:beans, if, proxy, registration, request, response, serviceProxy, soapProxy, stompProxy, swaggerProxy and transport


				<xmlContentFilter xPath="string" />
Listing 1: xmlContentFilter Syntax


					<serviceProxy port="2000">
							<xmlContentFilter xPath="//book/reviews" />
						<target host="www.membrane-soa.org" />
Listing 23: xmlContentFilter Example


Name Required Default Description Example
xPath true - An XPath 1.0 expression describing the elements to be removed from message bodies.


If the XPath expression is simple enough, a StAX-Parser is used to determine whether the XPath might match a message at all. This can improve performance significantly, as a DOM tree does probably not have to to be constructed for every message. This is, for example, the case in

 <xmlContentFilter xPath="//*[local-name()='Fault' and
              namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/']//*[local-name()='stacktrace']" />
Listing 23: xmlContentFilter using a StAX-Parser for improved performance
where the existence of the <Fault>-element is checked using the StAX-parser before the DOM is constructed.

If the message body is not well-formed XML, it is left unchanged. If the message is XOP-encoded, the XPath-expression is run on the reconstituted message; if it matches, the message is replaced by the modified reconstituted message.

Copyright © 2008-2017 predic8 GmbH
Koblenzerstr. 65, 53173 Bonn, Tel. +49 (228) 555 25 76-0