SAX and other XML APIs too low level?

jdavidb on 2002-08-26T13:21:35

Kip Hampton's review of the state of Perl and XML at OSCON states that SAX and most other currently available Perl APIs for XML are too low level:

It's hard to argue with complaints that the standard XML APIs are not high-level enough. SAX provides an excellent bridge between Perl's other data processing facilities and XML, but the hoops that you often have to jump through to maintain context while processing some documents can get very ugly very fast. The code required to generate well-formed XML documents by directly firing the appropriate SAX events is tedious and error-prone in all but the simplest cases.

Opinions? Is this a valid assessment? Matt always makes it sound so easy. :) I'm not there yet, so I just want to know.


They're both right...

darobin on 2002-08-26T15:07:17

It's not that it hard right now, it's that you can only work at the XML syntax level, and that gets tedious fast (and you can shoot yourself in the foot). I can write a SAX handler in a handful of minutes, it's not hard once you get the hang of it. But it's true that higher-level tools would certainly help people. Now, as for what those tools would be, I have no idea :)

Reach for a better tool?

dws on 2002-08-27T05:40:53

The code required to generate well-formed XML documents by directly firing the appropriate SAX events is tedious and error-prone in all but the simplest cases.


Yes, it's tedious and error prone, but this type of XML to XML translation is better handled by XSLT.