Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-18604

XpathRouteBuilder in Route Templates

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.18.2
    • 3.20.0
    • None
    • None
    • Unknown

    Description

      I like to use a split step with the XPathBuilder in a routetemplate.

      It's possible to create a template with a split like this:

               routeTemplate("split-xpath-router")
                       .templateOptionalParameter("expression")
                       .templateParameter("in")
                       .templateParameter("out")
                       .from("in")
                           .split().xpath("expression")
                               .to("out")
                          .end()

      However, it doesn't seem possible to use XPathBuilder in the template, because the template parameter doesn't get interpolated. This leads to:

      javax.xml.xpath.XPathExpressionException: net.sf.saxon.trans.XPathException: Unexpected token "{" at start of expression

      I tried with:

               routeTemplate("split-xpath-router")
                       .templateOptionalParameter("expression")
                       .templateParameter("in")
                       .templateParameter("out")
                       .from("in")
                           .split().xpath("expression")
                               .to("out")
                          .end()

      I tried it like this:

      .split(new XPathBuilder("").saxon().threadSafety(true))

      And

      .split().method(new XPathBuilder(""))

      I expected it something like this:

               routeTemplate("split-xpath-router")
                       .templateOptionalParameter("expression")
                       .templateParameter("in")
                       .templateParameter("out")
                       .from("in")
                           .split().xpathBuilder("expression").saxon().threadSafety("true")
                               .to("out")
                          .end()

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              skin27 Raymond
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: