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

Fwd: Re: What is XML For?

  • To: xml-dev@l...
  • Subject: Fwd: Re: What is XML For?
  • From: David Byrden <David@B...>
  • Date: Tue, 29 Oct 2002 12:16:46 +0000

jaxb existing class

 >> If I opt to use XML for the file format - that sorts of tools can I get 
for emitting the
 >> xml? I'm quite aware of parsers....
 >> Are there libraries that bridge the gap? (point me to java stuff if you 
like)

	JAXB is a Java API, released just about now, that lets
you generate Java classes directly from a schema. By default
it's an obvious mapping, i.e. an attribute becomes a member
variable, but you can customise the mapping freely with an
XML template file, for example mapping an element to a
pre-existing class or specifying a class of your own that will
do the translation (both ways) for that element type.

	It seems that Castor (mentioned by Jeff Lowery) is similar,
but it works on existing Beans whereas JAXB generates new bean-like
classes?

	So, to answer your question; you would instantiate objects
of these custom classes, initialise them and connect them up as
desired, then call a 'marshal' method for the root object, which
yields the XML.

	I've been trying the early-release implementation (based
on DTDs rather than schema) and I've enjoyed using it. It's a whole
lot more fun than running a DOM through an identity transformation.
When you want a 'customer' element, it's nice to be able to say
new Customer( "fred" ).

						David


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.