Presentation on theme: "Extensible Markup Language Natawut Nupairoj, Ph.D. Department of Computer Engineering Chulalongkorn University."— Presentation transcript:
Extensible Markup Language Natawut Nupairoj, Ph.D. Department of Computer Engineering Chulalongkorn University
Outline Overview. Basic XML Syntax. User-Defined XML Structure Document Type Definition.
Overview What is Markup Language ? Old style communication for editing. Between writer and editor. Example: This are is a mark-up. We can more text. add Sometimes, called “Metalanguage” ^
Overview Family of Computer Markup Language Standard Generalized Markup Language (SGML) Father of them all. Complex. HyperText Markup Language (HTML) The most popular child. Focus on presentation: for human.
Overview Extensible Markup Language (XML) Become increasingly popular. Similar to HTML. Focus on describing data For human and machine. Extensible Language for creating other languages. Base syntax. User-defined structure.
Example Tiger pantera tigris poachers habitat destruction trade in tiger bones for traditional Chinese medicine(TCM) 500 pounds 3 yards from nose to tail...
XML Siblings XML Structure Definition Document Type Definition (DTD). XML Schema. XML Parser DOM. SAX. XML-related technologies XSLT. XPath.
XML Components Element: tag and content Data. Tiger
XML Components Attribute: name and value Metadata = Data of Data. Tiger English Tiger
XML Components Nested element Tiger Panthera tigris 500 pounds
XML Components Empty element
XML Components Special symbols & for ampersand (&). < for less than sign (<). > for greater than sign (>). " for double quotation (“). ' for single quotation or apostrophe (‘). <500 pounds
XML Components Comment
Basic XML Syntax All XML files/applications must conform to basic XML syntax XML declaration is not required (but recommended). Tiger
Basic XML Syntax One and only one root element. Tiger
Basic XML Syntax Balanced and matched opening/closing tags. Tiger
Basic XML Syntax Case-sensitive. Tiger Case-sensitive.
User-Defined XML Structure XML basic syntax The pattern of all XML documents. Does not say about “structure”. Followed basic syntax = well-formed document. User-Defined XML Structure Which “tags” and “attributes” are allowed. Describe the structure. Followed “structure” = valid document.
Parser and DTD XML Parser XML Document Yes/No DTD Check input using basic syntax and DTD.
Document Type Definition (DTD) Old-fashioned, simple, but widely used. Internal DTD. ...
Document Type Definition (DTD) External DTD. ...
Defining Elements Tiger 500 pounds...
Defining Elements Tiger poachers 500 pounds...
Defining Elements 500 pounds 3 yards from nose to tail