Hi Nick,
I'm not sure I completely understand the issue, are you trying to write out
many standalone xml instances that all comprise a larger xml instance?
Wouldn't this be made simpler by keeping a reference to the 'parent'
instance around?
-jacobd

On Jan 4, 2008 7:44 AM, Nick Burch <[EMAIL PROTECTED]> wrote:

> 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]
>
>


-- 
I'm competing in a Half-Ironman distance triathlon to raise money for the
fight against cancer!
Please help support my efforts by going to:
http://www.active.com/donate/tntwaak/jacobd

Reply via email to