[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qexo-general] Output to a file, and formatting
From: |
Per Bothner |
Subject: |
Re: [Qexo-general] Output to a file, and formatting |
Date: |
Sat, 13 Nov 2004 09:23:58 -0800 |
User-agent: |
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.2) Gecko/20040803 |
Richard wrote:
1) output query results to a file, instead of the (default) screen;
Use the Qexo-specific write-to function:
http://www.gnu.org/software/qexo/Extensions.html#Implementation-specific-functions
2) format results... how do I get a carriage return between query
results, so instead of:
<a></a><a></a><a></a>
i can get:
<a></a>
<a></a>
Generate text nodes or string atomic values.
For example:
let $nl := "
"
for $i in (1, 2, 3) return
(<a></a>, $nl)
> what about indentation/tabs? so instead of:
If the structure of the quey matches the output (which is
the usual case) you can add string values or text nodes.
Here is a workin example:
declare xmlspace preserve;
for $x in (1,2) return
(<a num="$x">{
for $y in (1,2) return ("
",<b num="{$y}">{
for $z in (1,2) return ("
",<c num="{$z}">
</c>)}"
</b>)}
</a>,"
")
This allows you to fine-tune the output.
The xmlspace declaration is option; read the spec to
what it does. The current Qexo implementation isn't
quite according to spec in that it sometimes fails to
insert a space between string values. No big deal;
just a warning to expect some minor changes in future
versions.
Kawa also includes a pretty-printer that can add
automatic indentation. I need to provide a way to
allow you to control that.
--
--Per Bothner
address@hidden http://per.bothner.com/