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: playing with XML stuff


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/


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