RealTime IT News

BEA Releases Finalized StAX

After two years leading a project to deliver a better performance API for XML developers, BEA Systems, Inc. , is letting developers download the standardized product.

Streaming API for Java (StAX), the answer to many prayers among the development community, received the blessing of the 16-member executive committee in the Java Community Process Tuesday.

Implementation of the new standard should find its way into applications very soon. Chris Fry, BEA staff engineer and the lead in the Java specification request for StAX, said it has been a working model for more than a year-and-a-half.

"I think people will be using it right away," he said. "There's an open source project that BEA's involved with that's already using it, Oracle already has an implementation, Sun has an implementation. My feeling a year and a half ago was that this could be used, now a year and a half later there's been a pent up need for this standard."

The new standard fills a need that's been building within the Web services community for some time. The two existing APIs that handled XML processing requests -- Simple API for XML processing (SAX) and Document Object Model (DOM) -- were some of the first implementations for XML processing, but were memory- and speed-prohibitive.

APIs like DOM are tree-based, meaning they load the entire contents of the data regardless of what the application needs, requiring several times as much memory as the original data, while push APIs like SAX send the entire contents of the data to the application, whether that application is ready for it or not.

StAX is what developers consider a pull API, parsing only the information needed for the application when the user makes the request. This results in both speed and memory gains.

Diego Doval, CTO and co-founder of application developer clevercactus.com, tested StAX to see how it parsed his RSS feeds at his Weblog. Using SAX the time to process the feed was 140 milliseconds, with StAX it took 63milliseconds.

"The StAX code is a lot simpler than the SAX code, because it doesn't require a wrapper to make it look more event-based," he said. "Add to that the fact that StAX code runs at more than twice the speed of SAX and StAX wins hands down."

Despite the fact many of the individuals on the JSR were from companies that are normally competitors in the business arena, Fry said the whole process went smoothly.

"Really, the whole point of going to the JCP is to get adoption within the other companies that come to the JCP to participate," he said. "So by working with IBM, Sun, HP, Oracle, very early on they each have a stake in the API and implement it. Then you compete on the implementation."

Developers can download the API here.