Presentation is loading. Please wait.

Presentation is loading. Please wait.

DTDs : definitions. Defining Elements PCDATA: Parsed character data i.e., any characters without further XML structure.

Similar presentations


Presentation on theme: "DTDs : definitions. Defining Elements PCDATA: Parsed character data i.e., any characters without further XML structure."— Presentation transcript:

1 DTDs : definitions

2 Defining Elements PCDATA: Parsed character data i.e., any characters without further XML structure

3 Defining Elements Example: 0421-218-4283

4 Defining Elements: sequences Example: John Smith

5 Defining Elements: repetition and optionality <!ELEMENT name (first_name, middle_name*, last_name+)> ?Zero or one of the element *Zero or more of the element +One or more of the element

6 Defining Elements: choices <!ELEMENT digit (zero | one | two | three | four | five | six | seven | eight | nine | zero)> Example: stuff of some kind

7 Defining Elements: combinations <!ELEMENT circle (center, (radius | diameter)) > Examples: stuff of some kind 3m stuff of some kind 3m

8 Defining Elements: mixed content <!ELEMENT paragraph (#PCDATA | name | profession | footnote | emphasize | date )* > With this option, you cannot then count particular occurrences, nor can this appear as a sub- element in other definitions!

9 Defining Attributes Example: CDATA: character data

10 Attributes Types CDATA NMTOKEN : name token ID IDREF IDS IDREFS

11 Defining Attributes <!ATTLIST image source CDATA #REQUIRED alt CDATA #IMPLIED> Example: <image source=“my-picture.jpg” alt=“this is my picture”/>

12 ID Attributes Example: This is a difficult problem.

13 IDREF Attributes Example: This is a difficult problem.

14 IDREFS Attributes <!ATTLIST interesting turn IDREFS #REQUIRED> Example: This is a difficult problem.


Download ppt "DTDs : definitions. Defining Elements PCDATA: Parsed character data i.e., any characters without further XML structure."

Similar presentations


Ads by Google