camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Diesler (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAMEL-8314) Cannot select text() using xquery
Date Wed, 04 Feb 2015 13:09:34 GMT
Thomas Diesler created CAMEL-8314:
-------------------------------------

             Summary: 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


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)

Mime
View raw message