<!-- GerwinML DTD - Gerwin Table Markup Language -->
<!-- Public ID: "-//Jose E. Marchesi//DTD GewinML XML V0.1//EN" -->
<!-- Copyright (C) 2003 Jose E. Marchesi jemarch@gnu.org -->

<!-- 
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-->


<!-- root element -->
<!ELEMENT gerwinml (project)>

<!-- project element -->
<!ELEMENT project (tables | er)>

   <!ATTLIST project name    CDATA #REQUIRED
	             file CDATA #REQUIRED
                     author CDATA #REQUIRED
		     >		     

<!-- tables element -->
<!ELEMENT tables (table*)>

<!-- table element -->
<!ELEMENT table (table_attributes,table_restrictions?)>

    <!ATTLIST table name CDATA #REQUIRED>

<!-- table_attributes element -->
<!ELEMENT table_attributes (table_attribute+)>


<!-- table_attribute element -->
<!ELEMENT table_attribute>

  <!ATTLIST table_attribute name        CDATA        #REQUIRED
                            domain      CDATA        #REQUIRED
			    >		   

<!-- table_restrictions element -->
<!ELEMENT table_restrictions (primary_key*,not_nulleable*,foreign_keys*)>


<!-- primary_key element -->
<!ELEMENT primary_key (primary_key_attributes)>

<!-- primary_key_attributes element -->
<!ELEMENT primary_key_attributes (primary_key_attribute+)>

<!-- primary_key_attribute element -->
<!ELEMENT primary_key_attribute>

  <!ATTLIST primary_key_attribute name CDATA #REQUIRED>


<!-- not_nulleable element -->
<!ELEMENT not_nulleable (not_nulleable_attributes+)>

<!-- not_nulleable_attributes element -->
<!ELEMENT not_nulleable_attributes (not_nulleable_attribute+)>

<!-- not_nulleable_attribute -->
<!ELEMENT not_nulleable_attribute>

   <!ATTLIST not_nulleable_attribute name CDATA #REQUIRED>

<!-- foreign_keys element -->
<!ELEMENT foreign_keys (foreign_key+)>

<!-- foreign_key element -->
<!ELEMENT foreign_key (foreign_key_attributes)>

   <!ATTLIST foreign_key reference_table CDATA #REQUIRED>

<!-- foreign_key_attributes element -->
<!ELEMENT foreign_key_attributes (foreign_key_attribute+)>

<!-- foreign_key_attribute element -->
<!ELEMENT foreign_key_attribute>

   <!ATTLIST foreign_key_attribute name CDATA #REQUIRED
                                   rattribute CDATA #REQUIRED
				   >				   



