This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to have as-xml output to e.g. a (Scheme) string/port?


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]