We only talk about DTD and XML in class for 2 days and i have this assignment not sure if im doing it right or did everything that has been asked. Atleast i try, any help will be appreciated!!
Assignment You have been asked to represent airport data where an airport has required attributes name and location; and an implied attribute famous_assoiciation. The famous_assoication attribute is the name of a famous person after whom the airport has been named. An airport is composed of one or more hangers. Each hanger has a number, location and a set of 0 or more associated airlines. Each hanger also has a fixed attribute, length, of 2 miles. An airline has a name, one of more types of aircraft fleets (where a fleet contains one or more planes). A plane has a manufacturer, model, vin and seat_capacity. A plane also has attribute color with a default value of “silver”
You may assume that all data in this system is of type CDATA
This is what i did...
<!DOCTYPE airport [
<!ELEMENT airport (hanger+)>
<!ELEMENT hanger (number, location, airline*)>
<!ELEMENT number (#PCDATA)>
<!ELEMENT location (#PCDATA)>
<!ELEMENT airline (name, aircraft fleets+)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT aircraft fleets (plane+)>
<!ELEMENT plane (manufacturer, model, vin, seat_capacity)>
<!ELEMENT manufacturer (#PCDATA)>
<!ELEMENT model (#PCDATA)>
<!ELEMENT vin (#PCDATA)>
<!ELEMENT seat_capacity (#PCDATA)>
<!ATTLIST airport name CDATA #REQUIRED>
<!ATTLIST airport location CDATA #REQUIRED>
<!ATTLIST airport famous_assoiciation CDATA #IMPLIED>
<!ATTLIST plane color CDATA #FIXED "silver">
<!ATTLIST hanger length CDATA #FIXED "2 miles">
]>