Hi Elango,
changing the serialization parameters, here: output:separator option, [1] could
do the trick.
declare option output:separator "\n";
let $s :=
<interfaces>
<interface>
<name>intf0</name>
</interface>
<interface>
<name>intf1</name>
</interface>
<interface>
<name>intf2</name>
</interface>
<interface>
<name>intf3</name>
</interface>
</interfaces>
return
$s/interface/name/text()
==>
intf0
intf1
intf2
intf3
Hope this helps,
Alex
[1] http://docs.basex.org/wiki/Serialization
On 04.04.2013, at 11:47, elangovan MuthuSwamy <[email protected]> wrote:
> Hi All,
>
> I am using XQuery to evaluate an xpath. My code is as follows,
>
> /*Example xml I am using
> <interface>
> <name>intf0</name>
> </interface>
> <interface>
> <name>intf1</name>
> </interface>
> <interface>
> <name>intf2</name>
> </interface>
> <interface>
> <name>intf3</name>
> </interface>
> */
> XQuery query = new XQuery("/interfaces/interface/name/text()");
> String str = query.execute(ctx);
>
> // Result string is - intf0intf1intf2intf3
>
> I want the result such as
> intf0
> intf1
> intf2
> intf3
>
> I could not get the result list and I could not differentiate whether the
> result has multiple values or a single value.
>
> Please advice me if there is any other way to identify the result list.
>
> Thanks in Advance.
>
> --
> Regards,
> Elango.
> _______________________________________________
> BaseX-Talk mailing list
> [email protected]
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
_______________________________________________
BaseX-Talk mailing list
[email protected]
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk