Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

uh oh

I've done something evil. I've ported JSXML to C#.

I was sitting there, wasting keystrokes using System.Xml, and I remembered back to the days 4 years ago when I was using JSXML for browser-based and ASP XML manipulation. Simpler times, when one could add an xml element to a document in one line instead of 3, and the linear API of JSXMLBuilder meant I didn't have to drill down to individual elements every time a GUI action required change to a document...

I'm normally all about standards, but the W3C DOM just pisses me off with the horrible amount of waste. I mean, just look at DTD, it's an atrocity to use a seperate markup language to create validation for a markup language!!!

So I thought this might make an interesting discussion - both on .NET and standards in general. Has anybody else run into a standard API they detested?

I'll bet nobody here is familiar with JSXML (I LGPL'd it back in July, 2001), but the API for modifying XML is flat so that you can hook up GUI object's code directly to a particular element with ease. The parser API is seperate and is tree-based, if you only want to read XML, you only have to load the API for reading it. It's throws the W3C standards to the wind, but that makes it's code size (since it's intended to be downloaded to a browser - 1.91 kb!) and performance (it outperforms MSXML if you take into account MSXML's 200 ms initialization time) and simplicity better. With those factors in mind, is it horrible that it doesn't follow the standards?

But then, and the reason why I say it's evil, those factors apply only to the browser version - my C# port might outperform System.Xml because it does so much less, but other than that the only reason I use it is to eliminate (what I see as) wasted time on my part.

BTW, porting jscript to C# was fun and very easy, I'm going to LGPL the port once it's a little more robust :)

Pete
Wednesday, October 27, 2004

*  Recent Topics

*  Fog Creek Home