|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Doubt
Title: RE: Doubt Mudita, You can use the ID/IDREF technique in the DTD - i.e. an attribute of type "ID" would represent the primary key value, and an attribute of type "IDEF" would represent the foreign key value. The one-to-many relationship would therefore be ID-to-IDREF. Please note that there are some disadvantages to this approach: (1) An ID-type attribute value cannot begin with a number;
(3) An XML processor will not validate the associations between ID and IDREF values. That is, if A.1 contains the value "A123" and there is a B.2 (IDREF) value of "A123", that is great. However, if there is a value of "A123" for another IDREF-type attribute (perhaps C.2 instead of B.2), an XML processor will be happy with this even though the association is incorrect. To avoid these issues, you can use XML Schema and the KEY/KEYREF mechanism. In addition to avoiding (1) and (2) above, you can explicitly declare associations between elements or attributes - so you can ensure that (for instance) when there is a value of "A123" for an A.1 attribute, there must be a matching value of "A123" for a B.2 attribute (not just any attribute in the XML document). Hope that helps,
> **************************************************************************
-----Original Message-----
Hello all, I am new to this group and so might be asking a question which
If we have to make a DTD for a database with 2 tables, say A and
Table A
Table B
Now can anyone guide me on how to write a simple DTD for
secondly How to impose the many-to-many and one-to-many
Thanks
-----------------------------------------------------------------
The list archives are at http://lists.xml.org/archives/xml-dev/ To subscribe or unsubscribe from this list use the subscription
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








