By "struct" I think you mean you want an element
Your query selects a sequence of "racine" elements, and the
iteration over "books" assigns each one of these to the variable "book" in turn.
You are then extracting the string value - which is the concatenation of the
text node descendants of the "racine" element.
When you say you want the "struct", it's not clear to me
what you mean. Do you want the element as an object? You've got that in the
"book" item. Or do you want the element serialized as XML, in a string, that is
"<book>abc</book>" as a string of 16 characters? In that case you
need to serialize the item.
The simplest way to do this is
StreamResult(System.out), new Properties(), config);
If you want this in a variable, use
StringWriter writer = new
and new StreamResult(writer) as the second
I use Xquery with Saxon.
My code is :
Configuration config = new
StaticQueryContext staticContext = new
XQueryExpression exp =
dynamicContext = new
books = exp.iterator(dynamicContext);
This is run correctly but i would like an Xml Struct and
not just the value in my final variable . i would like "<book>XML
book</book>" and not just "XML book"
Is it a solution?
|This message contains
information that may be privileged or confidential and is the property
of the Capgemini Group. It is intended only for the person to whom it is
addressed. If you are not the intended recipient, you are not authorized
to read, print, retain, copy, disseminate, distribute, or use this
message or any part thereof. If you receive this message in error,
please notify the sender immediately and delete all copies of this