
On Wed, Feb 23, 2011 at 02:37:11PM -0800, sagarjauhari wrote:
Hello Ying,
Thanks for the reply. Yes, I guess it is indeed because of the text nodes. But is there a format output that enables quick tree visualization (other than using XSL) ? For exmaple, Altova XMLSpy (http://www.altova.com/xml-editor/) by default printed the output of: xquery>for $a in (1 to 3) return <number>{$a}</number> as <number>1</number> <number>2</number> <number>3</number>
I was trying to work with the \f option but in vain. Its a simple visualization feature and I was wondering if it could be solved without XSL.
Hello Sagar, You don't have to use XSL for this. You can just use the text element constructor to add a text node containing only a newline char at every place a line break in the query output is desired. Kind regards, Jennie
Thanks again, Sagar
Ying Zhang wrote:
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
------------------------------------------------------------------------------ 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
-- 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