|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: HashMap in an XML document
From: <arajvanshi@h...> > The problem is that some APIs have complex arguments like Vector, HashMap > which needs to be passed using XML. If I have to extract each and every element > of HashMap to form a new element in the XML doc, it will be a big overhead. I > wanted to ask whether we can directly pass an Object (like HashMap, Vector) in > an XML document by some means. You can serialize your objects to XML if you add an XML serialization method to all of them. Probably a more practical approach is to serialize just the big, self-contained problem objects (to Java's serialed format, then encode in Bin64), and send that data in XML elements which represent the rest of your data and its envelope. Then you only need to write the XML serialization methods for your higher-level and custom objects. So that way you get the advantages of XML (can route it through different platforms and use generic tools to process it) but not give yourself a lot of work for trying to serialize things that only the receiving Java program at the other end is interested in. Remember that a lot XML discussion assumes loose coupling; you don't know what language or OS or API is at the remote end. Your case is different, from what I gather, because your end-points are Java. Apparantly serialized Java can take more space than XML (if there are a lot of 32 bit references) too. Cheers Rick Jelliffe
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








