|
From: Eugene K. <eu...@md...> - 2005-09-27 17:51:05
|
Folks, I've implemented a sax-based parser for Spring's XML bean definition and wonder if you'd be interested to integrate this into Spring framework. this class can be used in place of the current DOM-based parser as well as an lightweight adapter for runtime app context generators such as xslt-based tools or tools like Jacn (even so I believe Jacn should directly generate Spring factories without intermediate XML representation). I run all existing tests from xml package and they all seem working just fine. That however required to have copies of XmlBeanDefinitionReaderand and XmlBeanFactory patched to work with my parser. In my tests this parser is little bit faster then current DOM-based parser and in my opinion it is structured little better then DOM-based parser. Basically is is sort-of stripped-down Digester (stack-based state machine) with declarative definitions for parsing rules. Interestingly the same rules could be used with StAX-based parser with very minimal changes or even without changes using adapter for SAX Attributes instance used in rule params. Also note that current XmlBeanDefinitionReader class is tight to DOM-based API and does not allow to hookup abstract XML parsers (e.g. SAX or StAX). This make impossible to substiture custom non-DOM XML parser to XmlBeanFactory. regards, Eugene |