If there was a standard XML schema to replace DDL everybody could use it everywhere they would formerly use DDL and obviously the presentation and editing and general management capabilities would be an order of magnitude better than, say, SQL-99 DDL text. There is a sick joke called SQLXML but it's only for SQL Server. I would say that if and when they release an industry standard XML schema to map SQL-XX that middlegen could use it but until then it's really beyond the scope of your product, IMO of course.
-----Original Message----- From: Aslak Helles�y [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 10:47 AM 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 = Something 2 See! http://www.vasoftware.com _______________________________________________ middlegen-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/middlegen-user
