You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Thomas Diesler (JIRA)" <ji...@apache.org> on 2015/02/06 09:01:34 UTC
[jira] [Comment Edited] (CAMEL-8314) Cannot select text() using
xquery
[ https://issues.apache.org/jira/browse/CAMEL-8314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14308809#comment-14308809 ]
Thomas Diesler edited comment on CAMEL-8314 at 2/6/15 8:01 AM:
---------------------------------------------------------------
great, thanks.
for the record ... this also works
{code}
Namespaces ns = new Namespaces("ns", "http://org/wildfly/test/jaxb/model/Customer");
from("direct:start").transform().xquery("/ns:customer/ns:firstName", String.class, ns)
{code}
was (Author: tdiesler):
great, thanks.
for the record ... this also works
```
Namespaces ns = new Namespaces("ns", "http://org/wildfly/test/jaxb/model/Customer");
from("direct:start").transform().xquery("/ns:customer/ns:firstName", String.class, ns)
```
> Cannot select text() using xquery
> ----------------------------------
>
> Key: CAMEL-8314
> URL: https://issues.apache.org/jira/browse/CAMEL-8314
> Project: Camel
> Issue Type: Bug
> Affects Versions: 2.14.1
> Reporter: Thomas Diesler
> Assignee: Claus Ibsen
>
> In [XQueryTransformTest|https://github.com/apache/camel/blob/master/components/camel-saxon/src/test/java/org/apache/camel/builder/saxon/XQueryTransformTest.java] we see this
> {code}
> <people><person name='Jonathan'/></people>
> ...
> transform().xquery("/people/person[@name='Jonathan']")
> {code}
> the expected result is
> {code}
> <person name=\"Jonathan\"/>
> {code}
> Note, this is the entire node - not just the value "Jonathan"
> When trying to select a node value like this
> {code}
> <people><person>Jonathan</person></people>
> ...
> transform().xquery("/people/person/text()")
> {code}
> I get
> {code}
> Caused by: net.sf.saxon.trans.XPathException: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted.
> at net.sf.saxon.dom.DOMWriter.characters(DOMWriter.java:218) [Saxon-HE-9.5.1-5.jar:]
> at net.sf.saxon.event.ProxyReceiver.characters(ProxyReceiver.java:193) [Saxon-HE-9.5.1-5.jar:]
> at net.sf.saxon.event.TreeReceiver.characters(TreeReceiver.java:246) [Saxon-HE-9.5.1-5.jar:]
> at net.sf.saxon.evpull.EventIteratorToReceiver.copy(EventIteratorToReceiver.java:49) [Saxon-HE-9.5.1-5.jar:]
> at net.sf.saxon.query.XQueryExpression.pull(XQueryExpression.java:516) [Saxon-HE-9.5.1-5.jar:]
> at org.apache.camel.component.xquery.XQueryBuilder.evaluateAsDOM(XQueryBuilder.java:179) [camel-saxon-2.14.1.jar:2.14.1]
> at org.apache.camel.component.xquery.XQueryBuilder.evaluate(XQueryBuilder.java:135) [camel-saxon-2.14.1.jar:2.14.1]
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)