120 likes | 288 Views
XML, DTD, ENTITY. Please see speaker notes for additional information!. <?xml version="1.0" ?> <!-- document type declaration follows --> <!DOCTYPE donors [ <!ELEMENT donors (donor+)> <!ELEMENT donor (name, address, yrfirst?, contact?, donations)> <!ATTLIST donor idno ID #REQUIRED>
E N D
XML, DTD, ENTITY Please see speaker notes for additional information!
<?xml version="1.0" ?> <!-- document type declaration follows --> <!DOCTYPE donors [ <!ELEMENT donors (donor+)> <!ELEMENT donor (name, address, yrfirst?, contact?, donations)> <!ATTLIST donor idno ID #REQUIRED> <!ELEMENT name (#PCDATA)> <!ATTLIST name title (Mr. | Mrs. | Ms. | Dr.) #IMPLIED> <!ELEMENT address (#PCDATA)> <!ELEMENT yrfirst (#PCDATA)> <!ELEMENT contact (#PCDATA)> <!ELEMENT donations (donation+)> <!ELEMENT donation (driveno, datecont, amtcont)> <!ATTLIST donation donationid ID #REQUIRED> <!ATTLIST donation givenby IDREF #REQUIRED> <!ELEMENT driveno (#PCDATA)> <!ELEMENT datecont (#PCDATA)> <!ELEMENT amtcont (#PCDATA)> ]> <donors> <donor idno="A1111"> <name title="Mr.">John Doe</name> <address> <![CDATA[ 123 Elm St Braintree, MA 02184 ]]> </address> <yrfirst>1995</yrfirst> <contact>Ann Smith</contact> Donations now contain a driveno which is part of the donation.
<donations> <donation donationid="A001" givenby = "A1111"> <driveno>A123</driveno> <datecont>7/5/2000</datecont> <amtcont>1200</amtcont> </donation> <donation donationid="B001" givenby = "A1111"> <driveno>B124</driveno> <datecont>5/14/2000</datecont> <amtcont>500</amtcont> </donation> </donations> </donor> <donor idno="B2222"> <name title="Ms.">Mary Wilson</name> <address> <![CDATA[ 14 Main St Fall River, MA 02770 ]]> </address> <yrfirst>1996</yrfirst> <contact>David Costa</contact> <donations> <donation donationid="A002" givenby = "B2222"> <driveno>A123</driveno> <datecont>5/15/2000</datecont> <amtcont>500</amtcont> </donation> </donations> </donor> Driveno has been made part of donation.
<donor idno="C3333"> <name title="Ms.">Nancy Taylor</name> <address> <![CDATA[ 1 Heritage Rd New Bedford, MA 02775 ]]> </address> <yrfirst>1994</yrfirst> <contact>Ann Smith</contact> <donations> <donation donationid="A003" givenby = "C3333"> <driveno>A123</driveno> <datecont>1/5/2000</datecont> <amtcont>1000</amtcont> </donation> <donation donationid="A004" givenby = "C3333"> <driveno>A123</driveno> <datecont>2/20/2000</datecont> <amtcont>600</amtcont> </donation> <donation donationid="B002" givenby = "C3333"> <driveno>B124</driveno> <datecont>1/12/2000</datecont> <amtcont>1000</amtcont> </donation> <donation donationid="C001" givenby = "C3333"> <driveno>C125</driveno> <datecont>5/5/2000</datecont> <amtcont>100</amtcont> </donation> </donations> </donor> <donor idno="D4444"> <name title="Mr.">Robert Brooks</name> <address> <![CDATA[ 45 East St Weymouth, MA 02176 ]]> </address> <yrfirst>1996</yrfirst> <contact>Roger Brown</contact> <donations> <donation donationid="A123005" givenby = "D4444"> <driveno>A123</driveno> <datecont>1/1/2000</datecont> <amtcont>500</amtcont> </donation> <donation donationid="B003" givenby = "D4444"> <driveno>B124</driveno> <datecont>5/1/2000</datecont> <amtcont>1000</amtcont> </donation> <donation donationid="C002" givenby = "D4444"> <driveno>C125</driveno> <datecont>8/1/2000</datecont> <amtcont>250</amtcont> </donation> </donations> </donor> </donors>
<?xml version="1.0" ?> <!-- document type declaration follows --> <!DOCTYPE donors SYSTEM "drive.dtd" [ <!ELEMENT donors (donor+)> <!ELEMENT donor (name, address, yrfirst?, contact?, donations)> <!ATTLIST donor idno ID #REQUIRED> <!ELEMENT name (#PCDATA)> <!ATTLIST name title (Mr. | Mrs. | Ms. | Dr.) #IMPLIED> <!ELEMENT address (#PCDATA)> <!ELEMENT yrfirst (#PCDATA)> <!ELEMENT contact (#PCDATA)> <!ELEMENT donations (donation+)> <!ELEMENT donation (driveno, datecont, amtcont)> <!ATTLIST donation donationid ID #REQUIRED> <!ATTLIST donation givenby IDREF #REQUIRED> <!ELEMENT driveno (#PCDATA)> <!ELEMENT datecont (#PCDATA)> <!ELEMENT amtcont (#PCDATA)> ]> <donors> <donor idno="A1111"> <name title="Mr.">John Doe</name> <address> <![CDATA[ 123 Elm St Braintree, MA 02184 ]]> </address> <yrfirst>1995</yrfirst> <contact>Ann Smith</contact>
<donations> <donation donationid="A001" givenby = "A1111"> <driveno>&A123;</driveno> <datecont>7/5/2000</datecont> <amtcont>1200</amtcont> </donation> <donation donationid="B001" givenby = "A1111"> <driveno>&B124;</driveno> <datecont>5/14/2000</datecont> <amtcont>500</amtcont> </donation> </donations> </donor>
<donor idno="B2222"> <name title="Ms.">Mary Wilson</name> <address> <![CDATA[ 14 Main St Fall River, MA 02770 ]]> </address> <yrfirst>1996</yrfirst> <contact>David Costa</contact> <donations> <donation donationid="A002" givenby = "B2222"> <driveno>&A123;</driveno> <datecont>5/15/2000</datecont> <amtcont>500</amtcont> </donation> </donations> </donor> <donor idno="C3333"> <name title="Ms.">Nancy Taylor</name> <address> <![CDATA[ 1 Heritage Rd New Bedford, MA 02775 ]]> </address> <yrfirst>1994</yrfirst> <contact>Ann Smith</contact> <donations> <donation donationid="A003" givenby = "C3333"> <driveno>&A123;</driveno> <datecont>1/5/2000</datecont> <amtcont>1000</amtcont> </donation> <donation donationid="A004" givenby = "C3333"> <driveno>&A123;</driveno> <datecont>2/20/2000</datecont> <amtcont>600</amtcont> </donation> <donation donationid="B002" givenby = "C3333"> <driveno>&B124;</driveno> <datecont>1/12/2000</datecont> <amtcont>1000</amtcont> </donation> <donation donationid="C001" givenby = "C3333"> <driveno>&C125;</driveno> <datecont>5/5/2000</datecont> <amtcont>100</amtcont> </donation> </donations> </donor> <donor idno="D4444"> <name title="Mr.">Robert Brooks</name> <address> <![CDATA[ 45 East St Weymouth, MA 02176 ]]> </address> <yrfirst>1996</yrfirst> <contact>Roger Brown</contact> <donations> <donation donationid="A123005" givenby = "D4444"> <driveno>&A123;</driveno> <datecont>1/1/2000</datecont> <amtcont>500</amtcont> </donation> <donation donationid="B003" givenby = "D4444"> <driveno>&B124;</driveno> <datecont>5/1/2000</datecont> <amtcont>1000</amtcont> </donation> <donation donationid="C002" givenby = "D4444"> <driveno>&C125;</driveno> <datecont>8/1/2000</datecont> <amtcont>250</amtcont> </donation> </donations> </donor> </donors>
<?xml version="1.0" ?> <!-- document type declaration follows --> <!DOCTYPE donors SYSTEM "http://www32.brinkster.com/pgrocer/DTD/drive.dtd" [ <!ELEMENT donors (donor+)> <!ELEMENT donor (name, address, yrfirst?, contact?, donations)> <!ATTLIST donor idno ID #REQUIRED> <!ELEMENT name (#PCDATA)> <!ATTLIST name title (Mr. | Mrs. | Ms. | Dr.) #IMPLIED> <!ELEMENT address (#PCDATA)> <!ELEMENT yrfirst (#PCDATA)> <!ELEMENT contact (#PCDATA)> <!ELEMENT donations (donation+)> <!ELEMENT donation (driveno, datecont, amtcont)> <!ATTLIST donation donationid ID #REQUIRED> <!ATTLIST donation givenby IDREF #REQUIRED> <!ELEMENT driveno (#PCDATA)> <!ELEMENT datecont (#PCDATA)> <!ELEMENT amtcont (#PCDATA)> ]> <donors> <donor idno="A1111"> <name title="Mr.">John Doe</name> <address> <![CDATA[ 123 Elm St Braintree, MA 02184 ]]> </address> <yrfirst>1995</yrfirst> <contact>Ann Smith</contact> <donations> <donation donationid="A001" givenby = "A1111"> <driveno>&A123;</driveno> <datecont>7/5/2000</datecont> <amtcont>1200</amtcont> </donation> <donation donationid="B001" givenby = "A1111"> <driveno>&B124;</driveno> <datecont>5/14/2000</datecont> <amtcont>500</amtcont> </donation> </donations> </donor> Http pointing to drive.dtd.
<?xml version="1.0" ?> <!-- document type declaration follows --> <!DOCTYPE donors [ <!ENTITY A123 "Childrens Drive"> <!ENTITY B124 "Lunch Drive"> <!ENTITY C125 "Shelter Drive"> <!ELEMENT donors (donor+)> <!ELEMENT donor (name, address, yrfirst?, contact?, donations)> <!ATTLIST donor idno ID #REQUIRED> <!ELEMENT name (#PCDATA)> <!ATTLIST name title (Mr. | Mrs. | Ms. | Dr.) #IMPLIED> <!ELEMENT address (#PCDATA)> <!ELEMENT yrfirst (#PCDATA)> <!ELEMENT contact (#PCDATA)> <!ELEMENT donations (donation+)> <!ELEMENT donation (driveno, datecont, amtcont)> <!ATTLIST donation donationid ID #REQUIRED> <!ATTLIST donation givenby IDREF #REQUIRED> <!ELEMENT driveno (#PCDATA)> <!ELEMENT datecont (#PCDATA)> <!ELEMENT amtcont (#PCDATA)> ]>
<donors> <donor idno="A1111"> <name title="Mr.">John Doe</name> <address> <![CDATA[ 123 Elm St Braintree, MA 02184 ]]> </address> <yrfirst>1995</yrfirst> <contact>Ann Smith</contact> <donations> <donation donationid="A001" givenby = "A1111"> <driveno>&A123;</driveno> <datecont>7/5/2000</datecont> <amtcont>1200</amtcont> </donation> <donation donationid="B001" givenby = "A1111"> <driveno>&B124;</driveno> <datecont>5/14/2000</datecont> <amtcont>500</amtcont> </donation> </donations> </donor>