Presentation is loading. Please wait.

Presentation is loading. Please wait.

XML - DTD. The building blocks of XML documents Elements, Tags, Attributes, Entities, PCDATA, and CDATA.

Similar presentations


Presentation on theme: "XML - DTD. The building blocks of XML documents Elements, Tags, Attributes, Entities, PCDATA, and CDATA."— Presentation transcript:

1 XML - DTD

2 The building blocks of XML documents Elements, Tags, Attributes, Entities, PCDATA, and CDATA

3 Elements main building blocks of both XML and HTML documents HTML elements are "body" and "table” XML elements could be "note" and "message“ can contain text, other elements, or be empty Examples of empty HTML elements are "hr", "br" and "img".

4 Tags Tags are used to markup elements. A starting tag like mark up the beginning of an element A body element: body text in between. A message element: some message in between

5 Attributes Attributes provide extra information about elements placed inside the start tag of an element Attributes come in name/value pairs E.g. the attribute is "src". value of the attribute is "computer.gif". Since the element itself is empty it is closed by a " /"

6 PCDATA PCDATA means parsed character data character data - the text found between the start tag and the end tag of an XML element. PCDATA is text that will be parsed by a parser Tags inside the text will be treated as markup and entities will be expanded.

7 CDATA CDATA also means character data CDATA is text that will NOT be parsed by a parser Tags inside the text will NOT be treated as markup and entities will not be expanded.

8 Entities Entities are variables used to define common text Entity references are references to entities the HTML entity reference: " " Entities are expanded when a document is parsed by an XML parser. << >> && "“ &apos;‘ The following entities are predefined in XML:

9 Declaring an Element elements are declared with an element declaration Empty elements – Elements with data – –or –example:

10 Elements with children (sequences)

11 Wrapping ]> Tove Jani Reminder Don't forget me this weekend

12 Declaring Attributes attributes are declared with an ATTLIST declaration DTD example: – XML example: –

13 TV Scedule DTD <!DOCTYPE TVSCHEDULE [ ]>

14


Download ppt "XML - DTD. The building blocks of XML documents Elements, Tags, Attributes, Entities, PCDATA, and CDATA."

Similar presentations


Ads by Google