
Hello Sagarjauhari, On Feb 23, 2011, at 17:19 , sagarjauhari wrote:
Hello, my xquery results are displaying only in a single line. The hello world example on http://monetdb.cwi.nl/XQuery/QuickTour/DOCMGT/ displays result correctly as:
doc("HelloWorld.xml")
<?xml version="1.0" encoding="utf-8"?> <doc> <greet kind="informal">Hi </greet> <greet kind="casual">Hello </greet> <location kind="global">World</location> <location kind="local">Amsterdam</location> </doc>
In the "Helloworld.xml" document, there is a text node between the nodes <doc>, <greet> and <location>, which contains newline and white spaces. The result of doc("HelloWorld.xml") includes these text nodes.
But this: xquery>for $a in (1 to 3) return <number>{$a}</number> outputs this: <XQueryResult><number>1</number><number>2</number><number>3</number></XQueryResult>
and for the file :test.xq: (1, 42.0, "Hello World", <node attr="value">test</node>)
the xquery mclient -lx -f xml test.xq outputs <?xml version="1.0" encoding="utf-8"?> <XQueryResult>1 42.000000 Hello World<node attr="value">test</node></XQueryResult>
So, this result is correct. If you want to print each node on a separate line, you need to explicitly add text nodes containing newlines (or maybe use another output format). Hope this helps a bit. Kind regards, Jennie
Any suggestions?
Thanks in advance -- View this message in context: http://old.nabble.com/monetdb-on-ubuntu-10.10---xquery-results-displaying-on... Sent from the monetdb-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------ Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users