[alicebot-archcomm] Whitespace clarification

Kim Sullivan alicebot-archcomm@list.alicebot.org
Tue, 16 Sep 2003 01:44:30 +0200


> I'm pretty sure it's not the same as the XML specification. The XML
> specification states that all whitespace must be passed to the
> application,
> but it must also provide the ability to notify it of which whitespace is
> considered ignorable. Which is where I've run into problems with the likes
> of the libxml2 parser ;-)

Hm... that's the question - which application is the application the
whitespace is passed to? Is it the template parser itself, or is it the
(part of the) application that's used to view the resulting parsed template?
And who's doing the passing, again - our interpreter, or the underlying
parser library we're using.

> That's what I'd think too .. I also used xmllint to process some
> sample aiml
> files, and get it to strip ignorable whitespace, and sometimes, tabs, and
> less often, newlines are left in the output file, which would be
> contrary to
> the AIML spec. I'll provide some sample files of what xmllint produces if
> that would help.

I don't think it would really because parsed AIML/XML isn't the same as
processed and interpreted aiml, which leads me to my next point:

> > you'd get "a test" in the variable and "a test for whitespace" as the
> > output. I'll check it with the XML spec but I think I got it
> more or less
> > right - what it basically comes down to is that you have no whitespace
> > besides spaces, and only one consecutive space, and no whitespace at the
> > beginning or the end (works for both variables and templates as
> a whole).
>
> I wish this was what was happening ;-)

And since we're not writing an XML parser but an AIML interpreter, can't we
just leave it like that in the spec and let the programmers work out the
details in their implementation? We could concentrate on accurately
describing the results, and not the process of getting there (and verifying
it's doable).

Kim

(Try P and tell me if it works out more or less the way you expect
whitespace handling to work)