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

Re: Instantiating XML code from XML schema - Best practice(and

  • From: Ronald Bourret <rpbourret@r...>
  • To: Erik Beijnoff <erik@a...>
  • Date: Thu, 27 Sep 2001 15:48:32 -0700

castor validator
I don't think that Castor (or any XML data binding product) is what you
are looking for. XML data binding creates data-specific objects from an
XML document. For example, if you have an XML document that represents a
sales order, the result of using a data binding product will be objects
like Order, Item, Customer, and Part. Other problems with data binding
are that data binding products generally ignore the order of sibling
elements and text in their parent and can't handle mixed content.

I think what you want is closer to a schema-driven editor. If you're
looking for a starting point, find a DTD-driven XML editor and modify
that to use schemas instead of DTDs. For a list of free editors, see:

  
http://www.garshol.priv.no/download/xmltools/cat_ix.html#SC_XMLEditors

-- Ron

> Erik Beijnoff wrote:
> 
> First I'd like to say that I'm sorry to turn to you, since list is
> full of postings anyway, but it seems like nobody else can answer the
> question, I've tried a bunch of forums, but it looks like I'm on my
> own on this one.
> 
> I'm trying to use xml schema as blueprints for xml files, using the
> xml schema as a class, sort of. The generated xml file would then be
> object created from the class. What I don't know is what technique I
> should use. Let me give you an example:
> 
> 1. I want to be able to generate a basic XML file from an XML schema.
> Take a look at the way XML Spy generates a XML file from a Schema.
> When you create a new XML document and tie it to a Schema, the program
> generates a sort of "basic XML setup". I believe it creates the
> Elements which has it's minOccurs="1" or something like that. That
> really doesn't matter, I can take care of all the details, I just need
> advice on what approach to use.
> 
> 2. And this is propably the most tricky one. I want to be able to put
> the cursor at any position in a XML document, then be able to add new
> elements as defined by the XML Schema for that element. In other
> words, if an element <a> has a XML schema defintion  <xsd:element
> name="a"> that tells me that it is a complex type to which elements of
> type <elm1> and <elm2> can be added, I want to be able to press a
> button "Create Element" and then choose from a list of possible
> elements via a dropdown or something similar. Ideally, the element
> added should be added as defined in 1).
> 
> This is supposed to be a normal client-server solution using Jsp and
> servlets. the closets I've gotten is Castor http://castor.exolab.org/
> which according to their specification can generate Java classes from
> Xml Schemas. But what they intend to use the classes for after that is
> only validation of existing xml files and for java-xml binding
> (marshalling and unmarshalling), not generating them. They don't
> mention generation anyway. But, I guess I can manage from there.
> 
> So, as of know, I only see that I've got two solutions: either
> modifying castor for my own purposes or ripping out the guts of the
> schema parts of xerces and creating something from their validator. I
> hope somebody has some practical experiences or some ideas about a
> best practice. Thank you.

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.