Hi All
We're experimenting with using xmlbeans for Apache POI, to help with the
processing of ooxml files. To do this, we've used xmlbeans to generate
classes from the xsd schema files.
The snag we're finding is due to an ooxml "file" actually being made up of
several different, interlinked xml documents, each in different parts of
the zipfile. When, say, opening a new sheet, the process is
something like:
* figure out what part of the file holds that sheet
* get that part of the file
* get the input stream from that part
* pass the input stream to the factory of the document xmlbean
* fetch the root bean of the document, and use that
However, when you want to write back out, the xml bean you're holding is a
long way from where it needs to go. You have to go from the useful bean
back to its parent, figure out what part of the overall file it came from,
get that, get an output stream from then, then finally call save.
This does seem like rather a lot of objects that you need to keep track of
(especially when considering a decent sized ooxml file, with say a core
part, half a dozen settings parts, and 5 different sheet parts).
What I had been expecting was a way to pass an object defining both
getInputStream() and getOutputStream() to the xml beans factory, and have
that be used. That way, you could just call save() on the xml bean, and
have it know how to get its own outputstream, and so there's then quite a
few fewer objects that I need to keep track of.
However, I couldn't seem to see anything like that. Is there some other
way that I'm missing to be able to easily associate the xmlbean with where
it came from, so that writing the bean back out again isn't too much faff?
Cheers
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]