I had suggested on the developer's mailing list that we look into using SAX XML file parsing in OFBiz instead of the current DOM parsing. The current XML file reading code uses DOM parsing - which results in two parsing passes: one to convert XML into DOM objects, and a second pass to convert the DOM objects into OFBiz objects. Using SAX, the XML elements are converted directly to OFBiz objects - bypassing the DOM tree construction step.
The responses to my suggestion brought up two points:
1. The XML files being parsed are relatively small. They are parsed once, then the objects are cached in memory. So, the performance improvement using SAX would be negligible.
2. SAX parsing code would be more complicated than the current DOM parsing code.
Point number one is probably right. It was point number two I wanted to explore: How complicated would the SAX parsing code be?
I found a small public-domain SAX parsing framework, so I started with that. I used the model screen widgets as a test. The conversion was pretty easy, and the SAX parsing code isn't any more complicated than the existing DOM parsing code. The attached patch is the result of my work.
This Jira issue is here for experimental and educational purposes only. The attached patch is NOT intended to be included in the project.