This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: how to have as-xml output to e.g. a (Scheme) string/port?
- From: Per Bothner <per at bothner dot com>
- To: "Hoehle, Joerg-Cyril" <Joerg-Cyril dot Hoehle at t-systems dot com>
- Cc: kawa at sources dot redhat dot com
- Date: Wed, 15 May 2002 11:49:41 -0700
- Subject: Re: how to have as-xml output to e.g. a (Scheme) string/port?
- References: <DFD875E85664D3118FA6080006277DE705823124@U8PN2.blf01.telekom.de>
Hoehle, Joerg-Cyril wrote:
> Even
> (with-output-to-file "C:/WinNT/TEMP/kawaXML.xml"
> (lambda () (as-xml (make-element 'p "The time is now: " (make-element 'code (make <java.util.Date>))))))
> yields an empty file and still prints to the terminal.
as-xml conceptually evaluates to a string, which is the xml-formatted
result of the argument. It does not by itself print anything.
It is a function, without side-effects.
with-output-to-file calls the given function in a context where standard
output is re-directed to the give file. It does not print the result
of the function.
> Why is gnu/kawa/slib/XML.scm print-nsxml-from-url commented out?
> It looks like it shows how to link a consumer to a Scheme port?
It's not a terribly useful function - it just copies am input
file (or url) to an output port.
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/