Announcement Announcement Module
No announcement yet.
XPath Selector - with multiple XPaths Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • XPath Selector - with multiple XPaths

    I'm trying to figure out how to set up a XPath Selector with multiple XPaths - basically I want to filter out a bunch of trades based on XPaths.

    The XPaths are going to come from a db - so there will be some kind of list built up and set on the the bean.

    I've looked at the selector stuff and can only see how I can do this with a single xpath expression - I'm now thinking about writing my own xpath selector that extends the spring one.

    Any help would be appreciated.



  • #2

    MessageSelectingInterceptor(MessageSelector selectors[])
    Last edited by; Jul 8th, 2011, 09:54 AM.


    • #3
      Could you please add a comment to this issue?:

      That way we will be sure to provide first class support for your use-case in 2.1.



      • #4
        Sorry I cant log in


        • #5
          So I ended up with this class called XPathsMessageSelectingInterceptor, as a quick fix. The ref "lookupOutboundXPathFilter" refers to a List<String> of XPaths that is pulled by a Method factory from my service bean. That all works fine ...

          <bean id="tradeOutboundInterceptor" class="com.acme.xml.XPathsMessageSelectingIntercep tor">
          <constructor-arg index="0" ref="lookupOutboundXPathFilter"/>

          So should I use it like this ???

          <int:channel id="tradeChannel">
          <ref bean="tradeOutboundInterceptor"/>

          public class XPathsMessageSelectingInterceptor extends MessageSelectingInterceptor
          * Construct an Array of BooleanTestXPathMessageSelectors
          public XPathsMessageSelectingInterceptor( List<String> xPathExpressions )
          super( newBooleanTestXPathMessageSelector(xPathExpression s) );

          * Static method to create a bunch of selectors
          public static BooleanTestXPathMessageSelector[] newBooleanTestXPathMessageSelector( List<String> xPathExpressions )
          BooleanTestXPathMessageSelector[] messageSelectors = new BooleanTestXPathMessageSelector[ xPathExpressions.size() ];

          for( int index = 0; index < xPathExpressions.size(); index++ )
          messageSelectors[index] = new BooleanTestXPathMessageSelector( xPathExpressions.get(index) );

          return messageSelectors;
          Last edited by; Jul 8th, 2011, 11:30 AM.