You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Matthew Pocock <ma...@ncl.ac.uk> on 2009/12/11 21:41:31 UTC

legacy xml code

Hi,

We have legacy code using stax for marshalling and unmarshalling our data.
For architectural issues (now fixed in stone) we are not able to use JAXB or
one of the other off-the-shelf solutions, as our APIs tightly control the
lifecycle of the objects they manage. So what we would like to do is tell
stax that it should give our code a stax reader or writer and let our code
get on with the job.

Is this possible? I have spent an hour googling, but haven't turned up an
example yet. I may be searching with the wrong words though.

Thanks,

Matthew

Re: legacy xml code

Posted by Benson Margulies <bi...@gmail.com>.
Set up your code as a data binding?

On Fri, Dec 11, 2009 at 3:41 PM, Matthew Pocock
<ma...@ncl.ac.uk> wrote:
> Hi,
>
> We have legacy code using stax for marshalling and unmarshalling our data.
> For architectural issues (now fixed in stone) we are not able to use JAXB or
> one of the other off-the-shelf solutions, as our APIs tightly control the
> lifecycle of the objects they manage. So what we would like to do is tell
> stax that it should give our code a stax reader or writer and let our code
> get on with the job.
>
> Is this possible? I have spent an hour googling, but haven't turned up an
> example yet. I may be searching with the wrong words though.
>
> Thanks,
>
> Matthew
>

Re: legacy xml code

Posted by Daniel Kulp <dk...@apache.org>.
There really are a couple options:

1) Write a databinding - since your code already uses Stax, this usually isn't 
hard.   You pretty much just need to wrapper it with our Reader/Writer 
interfaces.   The XMLBeans or SDO databinding (sdo is on trunk only right now) 
would be good starting points to look at.

2) Provider based service - if your service is implemented via the Provider 
interface, you can get a StaxSource and use that however you please.


Dan


On Fri December 11 2009 3:41:31 pm Matthew Pocock wrote:
> Hi,
> 
> We have legacy code using stax for marshalling and unmarshalling our data.
> For architectural issues (now fixed in stone) we are not able to use JAXB
>  or one of the other off-the-shelf solutions, as our APIs tightly control
>  the lifecycle of the objects they manage. So what we would like to do is
>  tell stax that it should give our code a stax reader or writer and let our
>  code get on with the job.
> 
> Is this possible? I have spent an hour googling, but haven't turned up an
> example yet. I may be searching with the wrong words though.
> 
> Thanks,
> 
> Matthew
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog