It does and I have used it and it works fine on a small schema. Here's the question: what XML schema is it generating? Answer: XML Spy's proprietary database schema. We really do need a standard for this.
-----Original Message----- From: Hal Deadman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 1:34 PM To: [EMAIL PROTECTED] Subject: RE: [Middlegen-user] xml schema from middlegen? It looks like XML Spy 5 has support for "Generation of DTD/Schema from database". Haven't tried it and don't own that version of the product yet, but at least someone must have a use for it. http://www.altova.com/matrix.html Search for "Generation of DTD/Schema from database". > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Hal > Deadman > Sent: Tuesday, February 04, 2003 2:45 PM > To: [EMAIL PROTECTED] > Subject: RE: [Middlegen-user] xml schema from middlegen? > > > 1) This page > (http://www.xml.com/pub/a/2000/11/29/schemas/part1.html?page=6) > describes how to model relations, although I am not an expert. It > appears that you would use the <xsd:key/> and <xsd:keyref/> to define > a pk type > constraint and an then refer to that constraint (fk-type > constraint). They > refer to elements via xpath and keyref refers to a key via > the key's name. > > 2) http://www.w3.org/XML/Schema is the standard. This is the standard > that is replacing DTDs. It's not necessarily meant to replace data > models but > there are many similarities between XML schemas and a > database schema. You > can enforce things in XML schema such as uniqueness, > relationships, data > types, constrained datatypes, etc that you couldn't do in > DTDs. I believe > J2EE 1.4 describes all of it's XML files (ejb-jar deployment > descriptors) > using XML schema instead of DTDs. > > 3) The reasons I was interested were because I need to provide XML > schemas that map closely to a database table for use with a JCA > adapter to a database in an XML based workflow tool. > > I also saw a proposal from BEA for XMLBeans that takes an XML schema > and generates XML schema aware and constrained java objects. > Wasn't planning to > use that but I thought it might be another reason to want to quickly > generate an XML schema. http://www.javaskyline.com/20030127_bea.html > http://workshop.bea.com/xmlbeans/XsdUpload.jsp > > On the XML schema home page, there is a big list of tools that work > with XML schemas, but I didn't notice any that help generate them > (from anything > other than DTDs). One example is Castor, which is described > as: "Castor > provides the only open-source Schema Object Model that loads > your XML Schema > in a Java representation. It also generates Java classes > given an XML Schema > and performs validation." Not being a Castor user, I don't > know if they > would benefit from having an XML schema generated for them or not. > > I looked into Torque which is a sub-project of Turbine on Jakarta. > They generate an "XML schema" from a database but it's not the > standard XML schema, rather it is a representation of a database the > schema in their own > XML format. > > XML Schema is supposed to be a big part of Microsoft Office 11, maybe > being able to create schemas from existing data models would be > useful there, > although maybe Microsoft supports that. I don't know. > http://www.microsoft.com/presspass/features/2002/nov02/11-12XM > LOffice.asp > > I don't really know how useful this would be for people and it may not > make sense. I am about to start a project where I will get some > exposure to XML > schema. As I learn more about XML schema, I will keep > Middlegen in mind and > see if I think it would be useful. > > Hal > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED]]On > Behalf Of Aslak > > Helles�y > > Sent: Tuesday, February 04, 2003 1:47 PM > > To: [EMAIL PROTECTED] > > Subject: RE: [Middlegen-user] xml schema from middlegen? > > > > > > 3 questions: > > > > 1) How would you model relations? Using ids? > > 2) Is there any kind of standard for this kind of schemas? > > 3) Who else than you would need this? > > > > Aslak > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED]]On > Behalf Of Hal > > > Deadman > > > Sent: 4. februar 2003 19:40 > > > To: [EMAIL PROTECTED] > > > Subject: [Middlegen-user] xml schema from middlegen? > > > > > > > > > I have run across a couple cases where it would be nice to > > have a W3C XML > > > Schema that mirrors an existing database schema. Are there > > any tools out > > > there that do that? Would that make sense as a middlegen plug-in > > > or at all? It wouldn't make use of Xdoclet but the information > > > that > > Middlegen has > > > regarding the tables, columns, and relationships would be used. > > > > > > One thing that wouldn't be typical of a Middlgen plug-in is that > > > there would be one velocity template to generate the entire XML > > > schema for the set of DB > > > tables rather than one template that gets executed for each table. > > > > > > I suppose there would have to be some mappings established > > between XML > > > datatypes and JDBC datatypes and this information would need to be > > > available in the template. > > > > > > I haven't worked much with XML Schema so most of what I > > know is based on > > > this article: > > > > > http://www.xml.com/pub/a/2000/11/29/schemas/part1.html?page=1 > > The article > > > talks about unique indexes and pk/fk type xml schema equivalents > > > on page 6. > > > > > > Below is an example of what a schema might look like for a > > single table. > > > > > > If you had a table like this: > > > CREATE TABLE COMPANY ( > > > COMPANY_ID NUMBER, > > > COMPANY_NAME VARCHAR2 (100), > > > TICKER VARCHAR2 (20), > > > MODIFIED_DATE DATE, > > > CREATED_DATE DATE) > > > > > > You could create a velocity template that generated a > > schema like this: > > > > > > <?xml version="1.0" encoding="UTF-8"?> > > > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > > elementFormDefault="qualified"> > > > <xsd:simpleType name="companyNameType"> > > > <xsd:restriction base="xsd:string"> > > > <xsd:maxLength value="100"/> > > > </xsd:restriction> > > > </xsd:simpleType> > > > <xsd:simpleType name="tickerType"> > > > <xsd:restriction base="xsd:string"> > > > <xsd:maxLength value="20"/> > > > </xsd:restriction> > > > </xsd:simpleType> > > > <xsd:complexType name="companyType"> > > > <xsd:sequence> > > > <xsd:element name="company_id" type="xsd:integer"/> > > > <xsd:element name="company_name" type="companyNameType"/> > > > <xsd:element name="ticker" type="tickerType"/> > > > <xsd:element name="modified_date" type="xsd:date"/> > > > <xsd:element name="created_date" type="xsd:date"/> > > > </xsd:sequence> > > > </xsd:complexType> > > > <xsd:complexType name="companyListType"> > > > <xsd:sequence> > > > <xsd:element name="company" type="companyType" minOccurs="0" > > > maxOccurs="unbounded"/> > > > </xsd:sequence> > > > </xsd:complexType> > > > <xsd:element name="companies" type="companyListType"/> > > > </xsd:schema> > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.NET email is sponsored by: > > > SourceForge Enterprise Edition + IBM + LinuxWorld = > Something 2 See! > > > http://www.vasoftware.com > > > _______________________________________________ > > > middlegen-user mailing list [EMAIL PROTECTED] > > > https://lists.sourceforge.net/lists/listinfo/middlegen-user > > > > > > ------------------------------------------------------- > > This SF.NET email is sponsored by: > > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > > http://www.vasoftware.com > > _______________________________________________ > > middlegen-user mailing list [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/middlegen-user > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld =omething 2 See! > http://www.vasoftware.com > _______________________________________________ > middlegen-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/middlegen-user ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld =omething 2 See! http://www.vasoftware.com _______________________________________________ middlegen-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/middlegen-user ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ middlegen-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/middlegen-user
