help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] Expat XML Parser extension


From: Robin Redeker
Subject: [Help-smalltalk] Expat XML Parser extension
Date: Sun, 23 Sep 2007 22:23:16 +0200
User-agent: Mutt/1.5.11+cvs20060403

Hi!

I just wanted to inform you that I've been writing an Expat
extension for gnu smalltalk today. I'll add some more documentation,
finish it up and send a path within the next week.

It's mainly a wrapper around the C API of Expat which emits SAX events,
which can be processed by the existing XML.SAXDriver implementation.

Expat is a stream parser and the smalltalk interface dows allow parsing
of unpositional streams like eg. sockets.

The good with the Expat parser is that it supports new (yet
currently not implemented in XML.st) SAX events which are defined by the
latest SAX extensions (such as cdata start/end and dtd start/end
detection, etc.).

The bad with Expat is that it requires yet another C lib.

Also the current interface returns String objects for all strings. Those
Strings are multibyte encoded (UTF-8) unicode. But writing a subclass
of the exising interface which decodes them to UnicodeString won't be a
big problem when someone needs it.

The expat parser also parses (encoded) byte streams (utf-8, iso, ascii
or utf-16 encoded) and not unicode strings. The current XML.XMLParser
implementation seems not to be able to parse byte streams and only
unicode strings (at least i want't able to throw in a UTF-8 encoded
document string).

Open questions with regard to the implementation are:

How/When do I correctly free the allocated expat C parser struct?
I'm currently storing the XML_Parser C struct as OOP in the Smalltalk
interface object. (Similar to the zlib implemenation).

But how do I ensure that the free function for it is called when my
interface object is destroyed?

I also put the package in packages/expat/ and used the zlib/ stuff as
skeleton for the building system. Is that okay?

I've also yet to discover how to create a patchset against the current
tla tree. But I guess I'll just have to read the manual again ;-/ (GIT
war a bit easier IMO :)



Robin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]