get string content from XQ_getXPath

Posted by gionnyDeep75 on 29-Sep-2010 05:45

Hi all

I try to fetch value form XQ_getXPath

But I cannot assign XQ_getXPath to a content part.

This is how I proceded:

    var inputPart = XQMessage.getPart(inPart);

    var indexInputPart=getPartIndex(inPart);

    var xpathNode=XQ_getXPath(xpath,indexInputPart);

    XQ_logInformation(xpathNode.enumerate().nextElement().textContent);

    var part=XQMessage.createPart();

    part.setContentId(outPart);

    part.setContent(xpathNode.enumerate().nextElement().textContent,"text/xml");

    XQMessage.addPart(part);

I return no value with xpathNode.enumerate().nextElement().textContent

Any idea?

Ciao

Giovanni

All Replies

Posted by Bill Wood on 06-Nov-2010 03:18

The xpath evaluation is probably returning nodes as java objects.  You need to convert it to a string.  The easiest way is to let the path evaluation return strings by using the string() function.    Instead of using xpath = /*[1] use xpath = string(/*[1])

This thread is closed