[ 
https://issues.apache.org/jira/browse/OFBIZ-2390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704409#action_12704409
 ] 

Adrian Crum commented on OFBIZ-2390:
------------------------------------

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.



> Proof Of Concept: SAX Parsing in Screen Widgets
> -----------------------------------------------
>
>                 Key: OFBIZ-2390
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2390
>             Project: OFBiz
>          Issue Type: Improvement
>    Affects Versions: SVN trunk
>            Reporter: Adrian Crum
>            Priority: Trivial
>
> See the comments for details.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to