This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: playing with XML stuff
- From: Per Bothner <per at bothner dot com>
- To: Nic Ferrier <nferrier at tapsellferrier dot co dot uk>
- Cc: kawa at sources dot redhat dot com
- Date: Fri, 04 Jan 2002 11:56:57 -0800
- Subject: Re: playing with XML stuff
- References: <00b301c1952b$d438a920$d4643dc0@gee.co.uk>
Nic Ferrier wrote:
> But when I do this:
>
> (print-as-xml
> (make-element 'p "The time is: "
> (make-element 'code (make <java.util.Date>))))
>
> I get the following:
>
> <pThe time is: ><code>Fri Jan 04 13:59:40 GMT 2002</code></p>
The problme is that XMLFormat is incomplete - and perhaps its
design is misguided.
The problem it tries to solve is to use a general mechanism for
associating a "format" with an OutPort. This is a useful feature,
and it would be nice to fit "xml format" into the framework.
However, an "xml format" requires state, which complicates
things.
This does need cleaning up. I'll take a look at it.
What does work is:
(require 'xml)
(as-xml ....)
However, as-xml returns multiple values, each of which is a character.
(It does uses a compact TreeList representation.) The result prints
ok, but it is not the same as a string. (The reason for returning
multiple values is that this fits well into the Consumer model.)
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/