Skip to content
Find file
2bb7a72 Mar 27, 2016
86 lines (71 sloc) 2.06 KB
<?xml version="1.0" ?>
<!--
Bookstore with DTD (Document Type Definition)
% xmllint 2-noout Bookstore1.dtd.xml
%
% xmllint 2-noout 2-valid Bookstore1.dtd.xml
%
Try changes:
Make Edition required
Swap order of First_Name, Last_Name
Add empty Remark
Add Magazine, omit closing tag
*: zero or more
+: one or more
?: zero or one
!ATTLIST: attribute list
#CDATA: character data
#IMPLIED: optional
#PCDATA: parsed character data
-->
<!DOCTYPE Bookstore [
<!ELEMENT Bookstore (Book | Magazine)*>
<!ELEMENT Book (Title, Authors, Remark?)>
<!ELEMENT Title (#PCDATA)>
<!ELEMENT Authors (Author+)>
<!ELEMENT Author (First_Name, Last_Name)>
<!ELEMENT First_Name (#PCDATA)>
<!ELEMENT Last_Name (#PCDATA)>
<!ELEMENT Remark (#PCDATA)>
<!ELEMENT Magazine (Title)>
<!ATTLIST Book ISBN CDATA #REQUIRED
Price CDATA #REQUIRED
Edition CDATA #IMPLIED>
<!ATTLIST Magazine Month CDATA #REQUIRED
Year CDATA #REQUIRED>
]>
<Bookstore>
<Book ISBN="ISBN-0-13-713526-2" Price="85" Edition="3rd">
<Title>A First Course in Database Systems</Title>
<Authors>
<Author>
<First_Name>Jeffrey</First_Name>
<Last_Name>Ullman</Last_Name>
</Author>
<Author>
<First_Name>Jennifer</First_Name>
<Last_Name>Widom</Last_Name>
</Author>
</Authors>
</Book>
<Book ISBN="ISBN-0-13-815504-6" Price="100">
<Title>Database Systems: The Complete Book</Title>
<Authors>
<Author>
<First_Name>Hector</First_Name>
<Last_Name>Garcia-Molina</Last_Name>
</Author>
<Author>
<First_Name>Jeffrey</First_Name>
<Last_Name>Ullman</Last_Name>
</Author>
<Author>
<First_Name>Jennifer</First_Name>
<Last_Name>Widom</Last_Name>
</Author>
</Authors>
<Remark>
Buy this book bundled with "A First Course" - a great deal!
</Remark>
</Book>
</Bookstore>
Something went wrong with that request. Please try again.