Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

serializing solution for org.w3c.Node

 
manuel aldana
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i want to transmit a Node through RMI. it is not possible to directly serialize it. has anyone an advice what is the standard solution to transform Node to a serializable format (-> maybe there is a mapping api for that).

first, i thought about transforming it to a String, but maybe there is a better way...?
 
manuel aldana
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i had a try to pass Node through a remote interface. it worked. so it seems that the (passed) implementation of the Node implements the Serializable interface (i get an DeferredDocumentImpl).

but still i want to rely on the interface type Node (could be that someone passes a non Serializable object). that means i do not expect a Serializable type. that's why i still look for a transformer from Node to a serializable type and backwards.

thanks.
[ September 14, 2007: Message edited by: manuel aldana ]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The standard serialized form of objects implementing the org.w3c.dom.Node interface is an XML document - text in other words.

It is time to step back and figure out what you really need to send. Note that there are many kinds of interfaces extending Node, each one having different content and text representation. Get familiar with the JavaDocs for Node - especially the elegant summary table.

Bill
 
manuel aldana
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
at both ends Node type is neccessary. think now that i will go for text transformation:

rmiClient.transformNodeToText -> rmiServerImpl.transformTextToNode
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic