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

camel-saxon: xquery fluent API does not work with namespaces (regression)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.4.0, 4.4.1, 4.4.2, 4.5.0
    • 4.4.3, 4.6.0
    • camel-saxon
    • None
    • Unknown

    Description

      This is a regression starting from 4.4.0

      Reproducer:
      https://github.com/DenisIstomin/camel-xquery-ns-bug

      Does not work:

      Namespaces ns = new Namespaces("soap", "http://schemas.xmlsoap.org/soap/envelope/");
      String strExpression = "exists(/soap:Envelope/soap:Header)";
      
      expression().xquery().expression(strExpression).resultType(String.class).namespaces(ns).end();
      

      Throws exception:

      net.sf.saxon.trans.XPathException: Namespace prefix 'soap' has not been declared
      

      Workaround is to use XQueryBuilder:

      XQueryBuilder xqueryBuilder = xquery(strExpression).resultType(String.class);
      xqueryBuilder.setNamespaces(ns.getNamespaces());
      

      Attachments

        Issue Links

          Activity

            People

              DenisIstomin Denis Istomin
              DenisIstomin Denis Istomin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: