DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Thomas has posted 33 posts at DZone. View Full User Profile

Spring Integration Xpath Header Enricher Sample

05.19.2011
| 4923 views |
  • submit to reddit
        // Sample Xpath Header Enricher using an XPath expression with namespace prefix.

  <si-xml:xpath-header-enricher id="environmentHeaderEnricher" 
      input-channel="in" 
      output-channel="out">
    <si-xml:header name="environment" xpath-expression-ref="environmentXpathExpression"/>
  </si-xml:xpath-header-enricher>
  
  <si-xml:xpath-expression id="environmentXpathExpression" 
      expression="/ns:Foo/ns:Bar/ns:Environment">
      <map>
          <entry key="ns" value="http://www.sample.dom/app/v3" />
      </map>
  </si-xml:xpath-expression>