Class 3 Notes for XML

Learning Objectives:

You will be able to create a DTD for an XML document

You will be able to create an internal and external DTD for an XML document

.You will be able to post an XML document on a Web server.


Read: Chapter 2

Quiz Next Week over XML Syntax and DTD!

Create a DTD for your  XML Resume & XML Address book

Prepare for the Quiz! Try completing the Practice Quiz (last years quiz!)

Post your Homework files and the assignments

FTP login



Username: Use your first initial plus last name

Password: Password you entered in class

Port: 990

Connection: FTPS

Click: Connect

Your homework must be linked to your homework.html file in your webs pace

Try downloading the FTP Program

Our Webs pace is at

Check out the FTP tutorials WS FTP for Windows.







You can also use FileZilla!

Filezilla's settings are the same just inputed to a different location


Username: Use your first initial plus last name

Password: Password you entered in class

Port: 990

Click: Quickconnect




Topics Covered:

Syntax for DTD:

Internal Reference: <!DOCTYPE RootElement [

<!ELEMENT name category> ...


External Reference: <!DOCTYPE RootElement SYSTEM "filelocation">

<!ELEMENT name category> for defining Elements

<!ATTLIST element-name attribute-name attribute-type default-value > for defining Attributes of Elements

<![CDATA[ reference a script or <img src='foo.gif'> ]]> Sample of Character data and including a reference to a link

Class XML will be used for this demonstration. Create a DTD for this example!

Finish the DTD so the XML file is valid. You have a DTD in the file for XML to complete the XML file.

DTD Notes:

DTDs are used to validate the XML documents structure and contents

DTD Notation:

Element will appear only once!
+ Element will appear one or more times!
<!ELEMENT element-name (child-name)>
<!ELEMENT element-name (child-name+)>
A * next to an Element means the Element will appear 0 or more times!
<!ELEMENT element-name (child-name*)>
, Elements must appear in the identified order
<!ELEMENT element-name (child-name1, child-name2, child-name3)>
A slash | means Elements can appear in any order
<!ELEMENT element-name (child-name1 | child-name2 | child-name3)>

DTD Provides:

    1. A way to specify (restricting) the type of data that needs to be in the XML document (Validating)

    2. A documentation of the XML document's structure

    3. A sharable description of an XML Document (something to design toward)

USE a DTD to specify content (only one DTD per document)

To identify a DTD you need to specify a


You can have an internal, external or mixed reference (both)


Quiz over XML Syntax and DTD Next Week!!

The Quiz will cover basic terms, syntax mistakes and creating an XML document from a DTD and DTD from an XML document.


Create a DTD for the NBA File and compare the DTD to this one I created.



FTP, DTD, XML, & Data Type



Dr. Jon Storslee
Phone: 602-787-6734

HTML Valid

Paradise Valley Community CollegeĀ 
18401 N. 32nd Street Phoenix, AZ 85032