[
https://issues.apache.org/jira/browse/CAMEL-20724?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-20724.
---------------------------------
Fix Version/s: 4.4.3
4.6.0
(was: 4.x)
Assignee: Denis Istomin
Resolution: Fixed
> camel-saxon: xquery fluent API does not work with namespaces (regression)
> -------------------------------------------------------------------------
>
> Key: CAMEL-20724
> URL: https://issues.apache.org/jira/browse/CAMEL-20724
> Project: Camel
> Issue Type: Bug
> Components: camel-saxon
> Affects Versions: 4.4.0, 4.4.1, 4.4.2, 4.5.0
> Reporter: Denis Istomin
> Assignee: Denis Istomin
> Priority: Minor
> Fix For: 4.4.3, 4.6.0
>
>
> This is a regression starting from 4.4.0
> Reproducer:
> [https://github.com/DenisIstomin/camel-xquery-ns-bug]
> Does not work:
> {code:java}
> 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();
> {code}
> Throws exception:
> {code:java}
> net.sf.saxon.trans.XPathException: Namespace prefix 'soap' has not been
> declared
> {code}
> Workaround is to use XQueryBuilder:
> {code:java}
> XQueryBuilder xqueryBuilder = xquery(strExpression).resultType(String.class);
> xqueryBuilder.setNamespaces(ns.getNamespaces());
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)