W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2001


From: Anna Sentyurina <ASentyurina@docutouch.com>
Date: Tue, 16 Jan 2001 08:44:50 -0800
Message-ID: <568CE4F83E85D411935100508B9A5F9628A050@DTSVRMAIL01>
To: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
I work on  DTD Content model
I have question : How to bind the  data ? I mean how to represent relations
between tables  ?
For example, I have two tables: Account and Account Type


Column	Data Type	Allow NULL	Unique	In PK	
AccountID	uniqueidentifier	No	Yes	Yes	
AccountName	varchar(64)	No	No	No	
CommunityID	int	No	No	No	
CreationDate	datetime	No	No	No	
IsActive	char(1)	No	No	No	
AccountHolder	uniqueidentifier	No	No	No	
ViewID	uniqueidentifier	No	No	No	
SignatureImage	image	Yes	No	No	


Column	Data Type	Allow NULL	Unique	In PK	
AffiliationID	uniqueidentifier	No	Yes	Yes	
AccountID	uniqueidentifier	No	Partial	No	
UserID	uniqueidentifier	No	Partial	No	
RoleID	int	No	No	No	
IsDefaultAffiliation	char(1)	No	No	No	
AffiliationStatusMask	int	No	No	No	
AccountAddressID	uniqueidentifier	Yes	No	No	
PermissionMask	int	No	No	No	

I want  to design my DTD schema and show, that  AccountID and UserId is the
same in both tables
I'm creating two groups: Account and AccountAffiliation.

<?xml version='1.0'?>

<!DOCTYPE schema>
SYSTEM 'http://www.docutouch.com/xmlschema/structures.dtd' >
        xmlns="http:www.docutouch.com/xmlschema/structures.dtd' ">

<schema targetNS="http://www.docutouch.com/xmlschema/Operations
<http://www.docutouch.com/xmlschema/Operations> "
<http://www.docutouch.com/xmlschema> ">
				<documentation xml:lang="en"
<http://www.docutouch.com/DesignRecords.doc> ">
      			The schema corresponding to this document is
      			with respect to the syntactic constraints it
expresses in the
      			XML Schema language.  


<type name="unique" type="boolean"/> 
<type name="allowNull" type="boolean"/> 
<type name="inPK" type="boolean"/> 

<group name="Account">
 	<element ref="AccountID"/>
 	<element ref="AccountName"/>
 	<element ref="CommunityID"/>
 	<element ref="CreationDate"/>
 	<element ref="IsActive"/>
 	<element ref="AccountHolder"/>
 	<element ref="CreationDate"/>
 	<element ref="ViewID"/>
 	<element ref="SignatureImage"/>


<element name="AccountID" />
  <group ref="Account"/>
   <attribute name="type" type="integer" > 0 />  
   <attribute name "unique" unique='true'/>
   <attribute name "allowNull" allowNull="false" />
    <attribute name "inPK" inPK='true'/> 	

<element name="AccountName">
   <group ref="Account"/>
   <attribute name="type" type="string"/>   
   <maxLength value='64'/>   
   <element ref="AccountID"/>

<element name="CommunityID">
   <group ref="Account"/>
   <attribute name="type" type="integer"/> 
   <attribute name "unique" unique='false'/>
    <attribute name "allowNull" allowNull="false" /> 
   <element ref="AccountID"/>

Received on Tuesday, 16 January 2001 11:46:52 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:54 UTC