How to retrieve data with FLWR expression using Tamino Java

I want to retrieve data with FLWR expression using Tamino Java API.

Does Tamino Java API support FLWR expression to retrieve data? And how can I do this?

Thanks!!

FLWR expressions are part of XQuery.

The Java API supports XQuery expressions.

I think that a normal installation of the Java API includes sample programs.

There should also be extensive documentation for the Java API.

I don’t know why the output is without value, can anyone help?

[color=“indigo”]xml document:

<client name=

i put your expression and XML doc in the Stylus Studio 2007(its a XML&Xquey edit-and-debug software), it returns the correct results.

i also have a similar problem, it works in the Stylus, but not in the Tamino API.

maybe someone will help us soon.

good luck!

I found that the getQueryContentAsString() output is at times less than you would expect.

If you actually iterate over the elements returned you should find that all the info is there as expected.

Thanks for your reply.

I have tried to use iterator to loop the data and display but still have problem. What can I do in the iterator loop to get the real value instead of null value?

Below is the code I have tried.

[color=“green”]TXQuery xquery = TXQuery.newInstance(“for $x in input()//client return $x”);

TResponse response = xmlObjectAccessor.xquery(xquery);

TXMLObjectIterator iterator = response.getXMLObjectIterator();
TXMLObject xmlObject = null;

while (iterator.hasNext()) {
xmlObject = iterator.next();
System.out.println(xmlObject.getElement())
}[/color]

Output:
[client:null]
[client:null]
[client:null]

You are using Element.toString() to produce the output. This is probably just showing details of the Element itself.

You would need to look at something like XmlSerializer to actually serialize the element.

I got it~
Thank so much!!
:smiley: