Presentation is loading. Please wait.

Presentation is loading. Please wait.

XML – A Quick Introduction Kerry Raymond (stolen from others)

Similar presentations


Presentation on theme: "XML – A Quick Introduction Kerry Raymond (stolen from others)"— Presentation transcript:

1 XML – A Quick Introduction Kerry Raymond (stolen from others)

2 © 2000, DSTC Pty Ltd2 What is XML? XML = Extensible Mark-up Language XML is a simplified version of SGML (Standard Generalized Mark-up Language) Standardised by W3C

3 © 2000, DSTC Pty Ltd3 Example XML The End of Science John Horgan 1996 Little, Brown and Company

4 © 2000, DSTC Pty Ltd4 XML mark up The main parts of an XML document are: –Tag –Element –Attribute

5 © 2000, DSTC Pty Ltd5 XML mark up - Tag Tags are the most familiar aspect of XML mark up. Kinds of tags: –Start tag:. –End tag:. Start and end tags form pairs, with some content between them. –Empty tags (no content):.

6 © 2000, DSTC Pty Ltd6 XML mark up - Element The portion of a document between an opening tag and its corresponding closing tag. Example: – The End of Science May be empty or have nested content.

7 © 2000, DSTC Pty Ltd7 XML mark up - Attribute Attributes belong to the element, rather than to the content of the element. For example, the attribute “id”: – Attributes are typed. For example: –CDATA (string). –Enumeration (one of a list of values) –ID (a unique identifier) –IDREF (reference to an ID – simple cross- reference)

8 © 2000, DSTC Pty Ltd8 XML example The End of Science John Horgan 1996 Little, Brown and Company

9 © 2000, DSTC Pty Ltd9 Well-formed vs. valid XML has two levels of acceptability: Well-formed documents. –Minimal level required by XML –Syntactically correct and opening and closing tags are properly nested. Valid documents. –Document must be well-formed and must satisfy the Document Type Definition in all details.

10 © 2000, DSTC Pty Ltd10 DTD A document type is defined by a DTD. The DTD defines: The tree structure a document of a given type can form. –The positions of elements, attributes and so on in document instances of that type. –The relationships between elements. Any constraints on each of the elements and attributes.

11 © 2000, DSTC Pty Ltd11 DTD – Example <!DOCTYPE bibliography [ <!ATTLIST bibItem id ID #REQUIRED type (article | book | report | video | audio) 'article'> ]>

12 © 2000, DSTC Pty Ltd12 So is it valid? The End of Science John Horgan 1996 Little, Brown and Company


Download ppt "XML – A Quick Introduction Kerry Raymond (stolen from others)"

Similar presentations


Ads by Google