Discussion:
[Middlegen-user] XML Schemas.
Dean Des Rosiers
2003-02-05 15:21:02 UTC
Permalink
I created a fairly simple plugin for Middlegen that creates XML Schemas for
me. It is very specific to my project, though. My SQL to XSL type mappings
are hard-coded, and in some cases are mapped to my own xs type definitions
(GUIDs, y/n, etc.).

I have two different schema types. One defines the table as a data type,
not an element. Each table’s column names and column data types are
described, as is the table’s PK (with an xs:key element). I do not outline
the foreign keys here. I use the other schema type for that.

The “dataset” schema type defines relationships among elements whose data
types are defined in the “table schemas.” It is “Russian doll” style, and
the relationships are mapped here. Foreign keys are described using key
refs. I use a dataset as a working set of data, kind of like a value object
tree, if I understand the latter correctly.

It was tricky to make it happen in Middlegen. I’ll converse with Hal (or
anybody) who wishes to attempt genericization of my code.

Dean Des Rosiers
Aslak Hellesøy
2003-02-05 15:42:07 UTC
Permalink
-----Original Message-----
Rosiers
Sent: 5. februar 2003 18:20
To: Middlegen
Subject: [Middlegen-user] XML Schemas.
I created a fairly simple plugin for Middlegen that creates XML
Schemas for
me. It is very specific to my project, though. My SQL to XSL
type mappings
are hard-coded, and in some cases are mapped to my own xs type definitions
(GUIDs, y/n, etc.).
I have two different schema types. One defines the table as a data type,
not an element. Each table’s column names and column data types are
described, as is the table’s PK (with an xs:key element). I do
not outline
the foreign keys here. I use the other schema type for that.
The “dataset” schema type defines relationships among elements whose data
types are defined in the “table schemas.” It is “Russian doll” style, and
the relationships are mapped here. Foreign keys are described using key
refs. I use a dataset as a working set of data, kind of like a
value object
tree, if I understand the latter correctly.
It was tricky to make it happen in Middlegen. I’ll converse with Hal (or
anybody) who wishes to attempt genericization of my code.
Dean Des Rosiers
Uplad it to the SF tracker. Provide some docs (preferrably xdoc format). If
your stuff is complete, I can commit it in CVS. If not, it'll take longer
:-)

Aslak
-------------------------------------------------------
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Rod Macpherson
2003-02-05 19:03:03 UTC
Permalink
This is very useful to use with castor. I use XML Spy to generate a
schema based on my database and then I use castor to generate classes
based on the XML schema. I could ditch XML Spy and use middlegen
instead.

The original XML schema question was a little different. In the original
request you would have a standard database schema
(midddlegen-db-schema.xsd) and middlegen would create "instances" of
that schema based on your database. The benefit is that middlegen could
then read configuration settings for table, column and relationships
from a strongly typed and highly structured instance of
middlegen-db-schema.xsd: different for each database.

-----Original Message-----
From: Dean Des Rosiers [mailto:***@desropolis.com]
Sent: Wednesday, February 05, 2003 9:20 AM
To: Middlegen
Subject: [Middlegen-user] XML Schemas.


I created a fairly simple plugin for Middlegen that creates XML Schemas
for me. It is very specific to my project, though. My SQL to XSL type
mappings are hard-coded, and in some cases are mapped to my own xs type
definitions (GUIDs, y/n, etc.).

I have two different schema types. One defines the table as a data
type, not an element. Each table's column names and column data types
are described, as is the table's PK (with an xs:key element). I do not
outline the foreign keys here. I use the other schema type for that.

The "dataset" schema type defines relationships among elements whose
data types are defined in the "table schemas." It is "Russian doll"
style, and the relationships are mapped here. Foreign keys are
described using key refs. I use a dataset as a working set of data,
kind of like a value object tree, if I understand the latter correctly.

It was tricky to make it happen in Middlegen. I'll converse with Hal
(or
anybody) who wishes to attempt genericization of my code.

Dean Des Rosiers



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
middlegen-user mailing list middlegen-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/middlegen-user

Loading...