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

RE: What is XML For?

  • To: "Jeff Lowery" <jlowery@s...>,<tblanchard@m...>,"xml-dev" <xml-dev@l...>
  • Subject: RE: What is XML For?
  • From: "Dare Obasanjo" <dareo@m...>
  • Date: Thu, 24 Oct 2002 11:40:46 -0700
  • Cc: "Paul Prescod" <paul@p...>
  • Thread-index: AcJ7jD1KAgmu6xsgR0q86qAgpGlNWQAAHAse
  • Thread-topic: What is XML For?

xml mapping.html
Similar functionality is available in the .NET Framework via XML Serialization. The following article on XML.com compares both mechanisms 
 
http://www.xml.com/pub/a/2002/07/24/databinding.html

	-----Original Message----- 
	From: Jeff Lowery [mailto:jlowery@s...] 
	Sent: Thu 10/24/2002 11:35 AM 
	To: tblanchard@m...; xml-dev 
	Cc: 'Paul Prescod' 
	Subject: RE:  What is XML For?
	
	

	> > That last bit - manipulate the data and then write a
	> modified version of
	> > it is something I don't see an analog for in XML.
	>
	> node.appendChildNode("foo")
	> doc.toXML()
	
	Or you can map class objects to XML structures using introspection:
	
	/**
	 * Helper method for marshalling objects to XML.
	 *
	 * @param obj Object to marshal.
	 */
	private static void marshallBean( Object obj )
	{
	        if (obj == null ) throw new RuntimeException( "obj is null" );
	
	        OutputStream os = System.out;
	        PrintWriter writer = new PrintWriter( os );
	         try
	        {
	                Marshaller.marshal(obj, writer);
	        }
	        catch (MarshalException e)
	        {
	                System.out.println( e.toString() );
	        }
	        catch (ValidationException e)
	        {
	                System.out.println( e.toString() );
	        }
	        writer.close();
	}
	
	The above code uses Castor's Java Bean marshaller.
	
	http://www.castor.org/xml-mapping.html
	
	Don't like the default marshalling behavior? Change it with a mapping file
	(XML format).
	
	Unfortunately Castor is written in, and only works with, dirty old Java.
	However Castor code is open source, so porting it to Smalltalk is possible
	by motivated individuals such as yourself.
	
	
	
	-----------------------------------------------------------------
	The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
	initiative of OASIS <http://www.oasis-open.org>
	
	The list archives are at http://lists.xml.org/archives/xml-dev/
	
	To subscribe or unsubscribe from this list use the subscription
	manager: <http://lists.xml.org/ob/adm.pl>
	
	


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.