Two cent:

I think that, starting the development of an application, using xml data, you start by 
making example xml instances at first. So the XMLInstance2Schema is not just useful 
when you get a schema, but actually a help at designing one. Not that I talk of 
experience, I followed this path by hand-coding the schema in the end, so far at all 
occasions. I will certainly go about it as descibed the next time.

> -----Original Message-----
> From: Keith Visco [mailto:kvisco@;intalio.com]
> Sent: Friday, October 18, 2002 7:14 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [castor-dev] The future of development of applications
> 
> 
> 
> To add to the design discussion, there may be times that you 
> run across
> XML data, but no schema and you have to handle operations on 
> this data.
> Instead of manually creating the schema, Castor can 
> automatically create
> an XML Schema given an XML document. The schema could then be 
> edited or
> used as-is for the basis of your data model.
> 
> For example, given the following data:
> 
> <?xml version="1.0"?>
> <people>
>    <person>
>       <name>John Smith</name>
>       <age>22</age>
>       <birth-date>1980-10-11</birth-date>
>       <address>
>          <street>1900 South Norfolk St.</street>
>             <city>San Mateo</city>
>          <state>CA</state>
>       </address>
>    </person>
>    <person>
>       <name>Jennifer Jones</name>
>       <age>27</age>
>       <e-mail>[EMAIL PROTECTED]</e-mail>
>    </person>
> </people>
> 
> Castor 0.9.4 will generate the following schema:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> xmlns="http://www.w3.org/2001/XMLSchema";>
>     <xsd:element name="people">
>         <xsd:complexType>
>             <xsd:sequence>
>                 <xsd:element name="person" maxOccurs="unbounded">
>                     <xsd:complexType>
>                         <xsd:sequence>
>                             <xsd:element name="name" 
> type="xsd:string"/>
>                             <xsd:element name="age" 
> type="xsd:integer"/>
>                             <xsd:element name="birth-date" 
> minOccurs="0"
> type="xsd:date"/>
>                             <xsd:element name="address" minOccurs="0">
>                                 <xsd:complexType>
>                                     <xsd:sequence>
>                                     <xsd:element name="street"
> type="xsd:string"/>
>                                     <xsd:element name="city"
> type="xsd:string"/>
>                                     <xsd:element name="state"
> type="xsd:string"/>
>                                     </xsd:sequence>
>                                 </xsd:complexType>
>                             </xsd:element>
>                             <xsd:element name="e-mail" minOccurs="0"
> type="xsd:string"/>
>                         </xsd:sequence>
>                     </xsd:complexType>
>                 </xsd:element>
>             </xsd:sequence>
>         </xsd:complexType>
>     </xsd:element>
> </xsd:schema>
> 
> 
> Notice that it merges the two <person> elements into one 
> definition and
> marks any elements that do not appear in both as optional.
> 
> To try this out on your own data, use:
> 
> java org.exolab.castor.xml.schema.util.XMLInstance2Schema input.xml
> output.xsd
> 
> --Keith
> 
> Sergej Maslyukov wrote:
> > 
> > Daniel, thank you for your answer.
> > 
> > Serg
> > 
> > --- [EMAIL PROTECTED] wrote:
> > > In my opinion the first path is most developmental
> > > and elastic.
> > >
> > > In my apps the basic model (XSD) is created in XML
> > > SPY.
> > > Next i'm generating object model in Castor Source
> > > Gen.
> > >
> > > My application using unmarshalling and marshalling
> > > to operate on large XML
> > > Documents.
> > >
> > > XSD used for object model generation is specially
> > > designed (is mostly based
> > > on Types Definition and inheritance) so that causes
> > > that my object model is
> > > very flexible because methods and services for each
> > > objects are separated
> > > from objects that holds only values.
> > >
> > > (relation MyObject_methods -> (inherits) ->
> > > MyObject_attributes_with
> > > getters_and_setters)
> > >
> > > That causes my application is easy to maintenance.
> > > All changes are made only on XSD level. On example
> > > i'm adding some
> > > attributes to xsd, regenerating model with Source
> > > Generator and writing some
> > > service methods operating on new attributes (service
> > > object are separeted
> > > from object that folds values so i'm overwriting
> > > only value objects).
> > >
> > > Next i'm using JDO to hold my XML data in DB.
> > >
> > > I think that solutions based on XSD model as a main
> > > maintenance and project
> > > design document and separating functionality
> > > (methods and services) from
> > > objects is quite good solution for fast and
> > > flexible developing.
> > >
> > >
> > > -----Original Message-----
> > > From: Sergej Maslyukov [mailto:serg_main@;yahoo.com]
> > > Sent: Thursday, October 17, 2002 4:43 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [castor-dev] The future of development of
> > > applications
> > >
> > >
> > > Hi!
> > >
> > > I would like to find out your opinion on the future
> > > of
> > > development of applications. Now there are some
> > > technologies permitting to reduce time of designing
> > > of
> > > the applications storing the information in
> > > databases
> > > - w3c schema, castor SourceGenerator, doclet, JDO
> > > and
> > > others. My question consists in SLEDU]EM, what path
> > > is
> > > preferable:
> > >
> > > - to start development from the schema (XMLspy?), on
> > > the basis of the schema to create a java classes
> > > (castor sourcegenerator) and tables (castor jdo,
> > > doclet) in the database
> > >
> > > - to create tables in the database (case tools -
> > > ERwin, Oracle designer?) to generate on their basis
> > > the schema (XMLspy) and a java classes (castor
> > > sourcegenerator?)
> > > - or there is other path?
> > >
> > >
> > > Serg Maslyukov
> > >
> > > __________________________________________________
> > > Do you Yahoo!?
> > > Faith Hill - Exclusive Performances, Videos & More
> > > http://faith.yahoo.com
> > >
> > >
> > -----------------------------------------------------------
> > > If you wish to unsubscribe from this mailing, send
> > > mail to
> > > [EMAIL PROTECTED] with a subject of:
> > >       unsubscribe castor-dev
> > >
> > >
> > -----------------------------------------------------------
> > >
> > > If you wish to unsubscribe from this mailing, send
> > > mail to
> > > [EMAIL PROTECTED] with a subject of:
> > >       unsubscribe castor-dev
> > >
> > 
> > __________________________________________________
> > Do you Yahoo!?
> > Faith Hill - Exclusive Performances, Videos & More
> > http://faith.yahoo.com
> > 
> > -----------------------------------------------------------
> > If you wish to unsubscribe from this mailing, send mail to
> > [EMAIL PROTECTED] with a subject of:
> >         unsubscribe castor-dev
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev
> 
> 

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to