Chapter 4: XML Part II
pages 1 - 26
Namespaces
DTDs: Document Type Definitions
Element Declarations
- <!ELEMENT name EMPTY>
- <!ELEMENT name (#PCDATA)>
- ()
- ,
- ?
- *
- +
- |
- Mixed Content: <!ELEMENT name (#PCDATA | element | ... )* >
Examples: demo.xml and
demo.dtd
Attribute Declarations
- <!ATTLIST element-name attribute-name attribute-type default-value ... >
- attribute-type: CDATA
- default-value: "some default"
- default-value: #REQUIRED
- default-value: #IMPLIED
- default-value: #FIXED "value"
Validation
Thursday Exercise
John will give you a well-formed XML file. During lab, you
should construct an internal DTD to go with this file, such that
the file validates. Copy your solution onto John's memory stick
when you are finished. 5 points.
Friday Exercise
John will give you an HTML file that you must convert into
an equivalent XHTML Strict file that validates. Copy your
solution onto John's memory stick when you are finished. 5
points.