how is the return result from a query written to a file?
thanks,
Nick
There are numerous ways to do so. Did you already check our documentation ( docs.basex.org)?
Nicholas saunders.nicholas@gmail.com schrieb am Di., 15. Dez. 2020, 18:15:
how is the return result from a query written to a file?
thanks,
Nick
ah, I see, it's using expath?
|file:write|($file as|xs:string|, $items as|item()*|) as|empty-sequence()| |file:write|($file as|xs:string|, $items as|item()*|, $params as|element(output:serialization-parameters)|) as|empty-sequence() something like that? |
On 12/15/20 9:15 AM, Nicholas wrote:
how is the return result from a query written to a file?
thanks,
Nick
pardon, forgot to include:
https://tech.forums.softwareag.com/t/writing-to-file-using-xquery/67224
where michael kay says that's just not going to work.
similarly, I'd want to feed the result into an xslt.
On 12/15/20 9:15 AM, Nicholas wrote:
how is the return result from a query written to a file?
thanks,
Nick
On Tue, 2020-12-15 at 09:19 -0800, Nicholas wrote:
pardon, forgot to include:
https://tech.forums.softwareag.com/t/writing-to-file-using-xquery/67224
where michael kay says that's just not going to work.
That's not exactly what he says - Mike words himself very carefully most of the time.
If you want to run XSLT on the result of a query you can use fn:transform() to do that from within XQuery, and you can write the result with file:write(), yes. Using xsl:resut-document from XSLT won't write anything out in that situation but will put the results into a map that your XQuery expression can save to a file.
You could also use an XProc pipeline, of course. But it depends on your situation and needs.
Liam
On 12/15/20 11:38 AM, Liam R. E. Quin wrote:
On Tue, 2020-12-15 at 09:19 -0800, Nicholas wrote:
pardon, forgot to include:
https://tech.forums.softwareag.com/t/writing-to-file-using-xquery/67224
where michael kay says that's just not going to work.
That's not exactly what he says - Mike words himself very carefully most of the time.
If you want to run XSLT on the result of a query you can use fn:transform() to do that from within XQuery, and you can write the result with file:write(), yes. Using xsl:resut-document from XSLT won't write anything out in that situation but will put the results into a map that your XQuery expression can save to a file.
You could also use an XProc pipeline, of course. But it depends on your situation and needs.
Liam
Fair enough, that was at least my takeaway. For the post-processing he mentions, this might be with
xsl:result-document as suggested?
thanks,
Nick
basex-talk@mailman.uni-konstanz.de