If it would help ... I could collect comments when the opf is parsed that are located anyplace in the opf and create a new pre-parsed data structure that holds all comments together in one place.
Then when rebuilding the opf on the fly after a change, I could insert all comments in the order they were found but all relocated to be either just before the metadata section or just before the manifest section or something along those lines. In other words create a space in the rebuilt opf for all comments that once existed someplace before parsing and rebuilding.
|