[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Transmitting XML between different applications

  • To: Chris Burdess <dog@b...>
  • Subject: Re: Transmitting XML between different applications
  • From: Mukul Gandhi <mukul_gandhi@y...>
  • Date: Mon, 21 Feb 2005 03:21:41 -0800 (PST)
  • Cc: XML Developers List <xml-dev@l...>
  • Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=Qs8CNwKMrbgDKIDGKTaEpWTW2ThrMNjDZSmTvj1ITLKo3FDfyZw68/dX8ymeEBQ2Z3KW0gc2sAAv22XWgERFFEBRiPeSyyks9WElsKe+MFTr0VvOcImkdvNV1sr5Bvri1Cd0ba5eYEWhcxNJIpXhBLLkba5kIC3xBzlgqnug1v4= ;
  • In-reply-to: <733b3863ad143b9d1eb67409061a5a41@b...>

getfeature ls 3.0
Thanks a lot for valuable information!

Regards,
Mukul

--- Chris Burdess <dog@b...> wrote:

> Mukul Gandhi wrote:
> > I want to understand the below statement, you have
> > written.. "not if you serialize it using the
> default
> > Java object serialization". Is it possible to
> > serialize Java DOM objects by some other methods
> than
> > default Java serialization method? How is it
> > implemented, and would it make Java DOM objects
> parser
> > neutral?
> 
> Mukul,
> 
> There are two standard ways to serialise a Java DOM
> Document.
> 
> 1. Use the DOM Load & Save facility if your DOM
> implementation supports 
> it, as this is likely to be more efficient:
> 
>       http://www.w3.org/TR/DOM-Level-3-LS/
> 
> Check whether the implementation supports it as
> follows:
> 
>    Document doc = ...;
>    DOMImplementation impl = doc.getImplementation();
>    if (impl.hasFeature("LS", "3.0")) {
>      DOMImplementationLS ls = (DOMImplementation)
> impl.getFeature("LS", 
> "3.0");
>      LSSerializer serializer =
> ls.createLSSerializer();
>      LSOutput output = ls.createLSOutput();
>      // configure output ...
>      serializer.write(doc, output);
>    }
> 
> GNU JAXP and Apache Xerces support DOM Load & Save.
> 
> 2. Use a JAXP identity transformer to serialise to a
> StreamResult.
> 
>    Document doc = ...;
>    Transformer identityTransformer = 
> TransformerFactory.getInstance().newTransformer();
>    DOMSource source = new DOMSource(doc);
>    StreamResult result = new StreamResult(...);
>    identityTransformer.transform(source, result);
> 
> Both these methods serialise to an OutputStream. The
> resulting stream 
> of characters is an XML document. It is as "parser
> neutral" as any XML 
> document - any XML parser parses XML. A DOM Document
> is not an XML 
> document, and is not XML. It is an
> application-internal representation 
> of an XML document in memory. The XML document is
> the sequence of bytes 
> beginning e.g. '<', '?', 'x', 'm', 'l', etc. Use XML
> as the transfer 
> format between different applications.
> -- 
> Chris Burdess



		
__________________________________ 
Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 
http://mobile.yahoo.com/maildemo 

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.