XML XML What XML is and what it means to me as a Computer Scientist By: Derek Edwards CS 376 March 10, 2003
XML Overview What is XML XML & HTML What does XML do Uses of XML XML & HTML Example XML Syntax Displaying XML Data Binding
XML What is XML? XML stands for: X tensible M arkup L anguage
XML What is XML? Very similar to HTML Designed to describe data No predefined tags like in HTML Uses a Document Type Definition (DTD) or an XML Schema to describe data
XML XML & HTML XML describes data HTML displays data
XML What does XML do? Nothing. XML is just a structure that stores data
XML Uses of XML Shares Data –Data is stored in a plain text format. –Lets different applications access the same information
XML Uses of XML Stores data –Used widely in database systems and file systems to store data –Applications can then be written to retrieve the stored data –Another application can then display the text in a certain way
XML Uses of XML Creates new languages –WML (wireless markup language) is written in XML
XML Simple HTML file note To: John From: Frank Subject: Reminder Message: Don’t forget the money you owe me Click here for online file
XML Same file in XML John Frank Reminder Don’t forget the money you owe me Click here for online file
XML XML File Line by Line John Frank Reminder Don’t forget the money you owe me _______________________________________________ XML declaration line, defines version and the character type Same as: · · · · ·
XML XML File Line by Line John Frank Reminder Don’t forget the money you owe me _______________________________________________ Describes the root element in the file “This document is a note” Same as: · · · · ·
XML XML File Line by Line John Frank Reminder Don’t forget the money you owe me _______________________________________________ The child elements in the file Same as: · · · · ·
XML XML Syntax All XML tags must have opening and closing tags All tags are case sensitive HTML This is paragraph 1… This is paragraph 2... XML This is paragraph 1... This is paragraph 2...
XML XML Syntax All XML tags must be nested properly HTML This is bold & italic XML This is bold & italic
XML XML Syntax Only one root element allowed John Frank Reminder Don’t forget the money you owe me ·
XML Another XML Example Empire Burlesque Bob Dylan USA Columbia Click for cd.xml
XML Displaying XML Can be displayed using a Cascading Stylesheet Preferred method is to use Extensible Stylesheet Language (XSL) Click for online CSS file Click for CD database with CSS file
XML Data Binding in XML “Data Islands” can be bound to HTML elements (like HTML Tables) Click for online version
XML Displaying XML Again Endless ways to display XML CD Database Example using and tags Another rendering of the CD Database CD Database using form elements and JavaScript Simple application for the CD Database Using and Full Rendering in Table Using Form Buttons Simple Application
XML XML Very versatile Code is completely customizable Display is completely customizable Becoming widely used Becoming more and more important Must have at least an understanding about it