Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIS 375—Web App Dev II DTD. 2 Introduction to DTD DTD stands for ______________________. The purpose of a DTD is to define the legal building blocks of.

Similar presentations


Presentation on theme: "CIS 375—Web App Dev II DTD. 2 Introduction to DTD DTD stands for ______________________. The purpose of a DTD is to define the legal building blocks of."— Presentation transcript:

1 CIS 375—Web App Dev II DTD

2 2 Introduction to DTD DTD stands for ______________________. The purpose of a DTD is to define the legal building blocks of an _____ document. A DTD can be declared inline in your XML document, or as an _________ reference.

3 3 DTD Declared Inline w/ XML <!DOCTYPE note [ ]> Tove Jani Reminder Don't forget me this weekend!

4 4 External DOCTYPE Declaration XML file Tove Jani Reminder Don't forget me this weekend! note.dtd

5 5 Why Use a DTD? Each of your XML files can carry a description of its own ________ with it. Independent groups of people can agree to use a common DTD for interchanging data. Your application can use a standard DTD to ______ the data you receive from the outside world. To verify your own data.

6 6 Building Blocks of XML/HTML Elements like “body” in HTML, XML has its own elements (“note”) Tags the “body” element has tags and Attributes info about elements ( ) Entities variables used to define text (e.g., ) PCDATA—parsed (___________) character data CDATA—character data, not parsed

7 7 Specifying Elements I Empty element: Element w/ character data only: Element w/ any content: Element with children:

8 8 Specifying Elements II Minimum one occurrence of the same element: Zero or more occurrences of the same element: Zero or _____ occurrence of the same element: Declaring either/or content: Declaring mixed content:

9 9 DTD Attributes Declaring an attribute of an XML element: In the XML file: A value is just required: Only the value “check” is allowed: Different values are allowed:

10 10 DTD Entities Entities are variables used to define shortcuts to common text. In the XML file: &writer;&copyright; __________ entity declaration: In the XML file: &writer;

11 11 Example <!DOCTYPE NEWSPAPER [ ]>


Download ppt "CIS 375—Web App Dev II DTD. 2 Introduction to DTD DTD stands for ______________________. The purpose of a DTD is to define the legal building blocks of."

Similar presentations


Ads by Google