[Mono-devel-list] Re: Another XML API: SAX

Karl Waclawek karl at waclawek.net
Wed Nov 12 11:08:23 EST 2003

> Hello,
> > Is anyone aware if the SAX API (and implementations of it) are
> > available on .NET/Mono? If not, is this a no-starter - as
> > there is already System.XML?
> >
> > Would anybody be interested in having the SAX API available
> > for .NET/Mono?
> In general, .NET XML developers use XmlReader (XmlTextReader) as XML
> parser. XmlReader is kind of pull parser. It is similar to XMLPull, or
> StAX (streaming API for XML) etc. in Java world.

I know, that is why I was asking.
> However, SAX-skilled programmers might be glad to have .NET SAX (while
> some Java developers might think .net sucks ;-P )  At least I haven't
> seen such product. It will be easily implemented using XmlReader.

Yes, SAX on top of pull is always possible. But it can be done directly too.
I have experience porting SAX from Java to Delphi.
I also wrote a SAX2 wrapper for Expat in Delphi.

I thought about porting the SAX2 API including the helper classes
first, and then - for the speed freaks - port the Expat wrapper to C# as well.
I am fairly new to C#, but it seems easy to get into.
What I am lacking is experience writing code with a GC in mind,
but that will come in due course.

I have already ported the interfaces - which is easy - but I am
not sure if I should stick to the Java signatures or go C# all
the way. I have followed the .NET naming conventions instead of
the Java ones, but did not convert all those getXXX() and setXXX()
methods to property accessors, as this would make it more work 
porting code from Java to C#.

Also, what about namespaces? Currently I have defined namespaces
along the lines of the Java packages (SAX, SAXExt, SAXHelpers). 
But they are top level right now.
Should they not be inserted in some hierarchy?

Is there any consensus on issues like that?


More information about the Mono-devel-list mailing list