Serializing to and from Element

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

Serializing to and from Element

by Rob Griffin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Niall,
 
We need a way of serializing to and from an Element instead of a steam because we embed our object’s XML inside other XML.
Can Simple do this as it stands?
 
Thanks,
 
Rob Griffin
Quest Software
 
 
 

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Serializing to and from Element

by niall.gallagher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,
 
Simple started off using DOM. It progressed to 1.0 before I wrote a DOM like wrapper around StAX. The org.simpleframework.xml.stream package is 100% interfaces, which is very similar to DOM. I think all you need to do is implement the InputNode and OutputNode around a org.w3c.dom.Element as well as Position, which is easy. It should be a very easy job, I have not had time to do it myself. But I implemented org.simpleframework.xml.stream for this exact issue.
 
Niall
 
 

From: Rob Griffin [mailto:rob.griffin@...]
Sent: 20 October 2009 01:18
To: simple-support@...
Subject: [Simple-support] Serializing to and from Element

Niall,
 
We need a way of serializing to and from an Element instead of a steam because we embed our object’s XML inside other XML.
Can Simple do this as it stands?
 
Thanks,
 
Rob Griffin
Quest Software
 
 
 
***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
Authorised and regulated by the Financial Services Authority. 
 
This e-mail message is confidential and for use by the 
addressee only. If the message is received by anyone other 
than the addressee, please return the message to the sender 
by replying to it and then delete the message from your 
computer. Internet e-mails are not necessarily secure. The 
Royal Bank of Scotland plc does not accept responsibility for 
changes made to this message after it was sent. 

Whilst all reasonable care has been taken to avoid the 
transmission of viruses, it is the responsibility of the recipient to 
ensure that the onward transmission, opening or use of this 
message and any attachments will not adversely affect its 
systems or data. No responsibility is accepted by The 
Royal Bank of Scotland plc in this regard and the recipient should carry 
out such virus and other checks as it considers appropriate. 

Visit our website at www.rbs.com

***********************************************************************************

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Serializing to and from Element

by Rob Griffin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Niall,

 

I think the Serializer interface is missing some methods.

 

public <T> T read(java.lang.Class<? extends T> type, InputNode source)  throws java.lang.Exception

 

is in Persister but not in Serializer.

 

Ditto:

 

public void write(java.lang.Object source, OutputNode root) throws java.lang.Exception

 

That means for the moment I have to change my code from

 

Serializer serializer = new Persister();

 

To

 

  Persister persister = new Persister();

 

in order to implement reading from and writing to an Element.

 

Thanks,

 

Rob Griffin.

 

From: niall.gallagher@... [mailto:niall.gallagher@...]
Sent: Tuesday, 20 October 2009 7:30 PM
To: Rob Griffin; simple-support@...
Subject: RE: Serializing to and from Element

 

Hi,

 

Simple started off using DOM. It progressed to 1.0 before I wrote a DOM like wrapper around StAX. The org.simpleframework.xml.stream package is 100% interfaces, which is very similar to DOM. I think all you need to do is implement the InputNode and OutputNode around a org.w3c.dom.Element as well as Position, which is easy. It should be a very easy job, I have not had time to do it myself. But I implemented org.simpleframework.xml.stream for this exact issue.

 

Niall

 

 


From: Rob Griffin [mailto:rob.griffin@...]
Sent: 20 October 2009 01:18
To: simple-support@...
Subject: [Simple-support] Serializing to and from Element

Niall,

 

We need a way of serializing to and from an Element instead of a steam because we embed our object’s XML inside other XML.

Can Simple do this as it stands?

 

Thanks,

 

Rob Griffin

Quest Software

 

 

 

 
***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
Authorised and regulated by the Financial Services Authority. 
 
This e-mail message is confidential and for use by the 
addressee only. If the message is received by anyone other 
than the addressee, please return the message to the sender 
by replying to it and then delete the message from your 
computer. Internet e-mails are not necessarily secure. The 
Royal Bank of Scotland plc does not accept responsibility for 
changes made to this message after it was sent. 
 
Whilst all reasonable care has been taken to avoid the 
transmission of viruses, it is the responsibility of the recipient to 
ensure that the onward transmission, opening or use of this 
message and any attachments will not adversely affect its 
systems or data. No responsibility is accepted by The 
Royal Bank of Scotland plc in this regard and the recipient should carry 
out such virus and other checks as it considers appropriate. 
 
Visit our website at www.rbs.com
 
***********************************************************************************

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