Using Simple XML to write a DOMResult or read a Source

View: New views
2 Messages — Rating Filter:   Alert me  

Using Simple XML to write a DOMResult or read a Source

by patb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

currently I'm working on a project that uses Spring WebServices.
There, you can use several marshaller to marshal (serialize) or
unmarshal (deserialize) XML (from the SOAP body) data.

Throughout the project, I use Simple XML a lot. So I would like to
use it as a marshaller also.

The point is, that Simple must be able to deserialize to a

  org.w3c.dom.Document

or better to a

  javax.xml.transform.dom.DOMResult .

The other way around I would like to let Simple XML read a

  org.w3c.dom.Document

or a

  javax.xml.transform.Source .


With these I would be able to create a Spring WS marshaller based on
Simple XML. Maybe it is not too hard to implement such a
functionality? I would think that Simple XML already uses some kind of
DOM document internally.


I appreciate any help you can offer


Thanks a lot!


Best regards,
Timo Rumland


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Using Simple XML to write a DOMResult or read a Source

by jpkutner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I agree that these would be really useful characteristics of the
framework.  Deserializing from a Document/Node or a DOMSource should
be easy.  I have a attached a patch that allows for it.  With it you
can do the following:

T t = persister.read(T.class, new DOMSource(myW3cNode));

But I suspect Niall will tell us that serializing to objects of these
types will be trickier.  I may try to write a
org.simpleframework.xml.stream.OutputNode to org.w3c.dom.Node
converter -- that would be useful to me as well but not ideal for
performance.  If so, I will certainly share it.

Joe Kutner

On Mon, Sep 7, 2009 at 5:29 PM, Timo Rumland<cr@...> wrote:

> Hello,
>
> currently I'm working on a project that uses Spring WebServices.
> There, you can use several marshaller to marshal (serialize) or
> unmarshal (deserialize) XML (from the SOAP body) data.
>
> Throughout the project, I use Simple XML a lot. So I would like to
> use it as a marshaller also.
>
> The point is, that Simple must be able to deserialize to a
>
>  org.w3c.dom.Document
>
> or better to a
>
>  javax.xml.transform.dom.DOMResult .
>
> The other way around I would like to let Simple XML read a
>
>  org.w3c.dom.Document
>
> or a
>
>  javax.xml.transform.Source .
>
>
> With these I would be able to create a Spring WS marshaller based on
> Simple XML. Maybe it is not too hard to implement such a
> functionality? I would think that Simple XML already uses some kind of
> DOM document internally.
>
>
> I appreciate any help you can offer
>
>
> Thanks a lot!
>
>
> Best regards,
> Timo Rumland
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Simple-support mailing list
> Simple-support@...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

persister-with-source.patch (2K) Download Attachment