Uploaded image for project: 'FUSE Mediation Router'
  1. FUSE Mediation Router
  2. MR-702

Inability to set lenient mode on JXPath in camel routes

    XMLWordPrintable

Details

    Description

      Hi,

      If I modify JXPathFilterTest [1] to not include a value:

      //filter().jxpath("in/body/name2='James'").
      filter().jxpath("in/body/name2").

      I receive the following error:

      Caused by: org.apache.commons.jxpath.JXPathNotFoundException: No value for xpath: in/body/name2

      It seems JXPath has a way to avoid throwing this error by using lenient mode [2], i.e:

      context.setLenient(true);

      I quickly updated ./src/main/java/org/apache/camel/language/jxpath/JXPathExpression.java to set this value to true and indeed the test case passes. Can we add a way for users to set this option?

      Susan

      [1] http://svn.apache.org/repos/asf/camel/trunk/components/camel-jxpath/src/test/java/org/apache/camel/language/jxpath/JXPathFilterTest.java
      [2] http://commons.apache.org/proper/commons-jxpath//users-guide.html#Lenient_Mode

      Attachments

        Activity

          People

            cibsen@redhat.com Claus Ibsen
            rhn-support-sjavurek Susan Javurek
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: