Demystifying the eXtensible Markup Language Nick Roberts & Jim Few
What is XML? Why should I care? How can I use XML? What is XML? Why should I care? How can I use XML? Agenda
W3C: What is XML? The eXtensible Markup Language (XML) is a markup language that provides a format for describing structured data. XML was designed to describe, store, carry, and exchange data. XML tags are not predefined like HTML. You must define your own tags. XML uses an XML schema to describe the data. XML can be transformed into other formats with XSLT. The eXtensible Markup Language (XML) is a markup language that provides a format for describing structured data. XML was designed to describe, store, carry, and exchange data. XML tags are not predefined like HTML. You must define your own tags. XML uses an XML schema to describe the data. XML can be transformed into other formats with XSLT.
What XML is Not Something to be afraid of A replacement for HTML A replacement for relational databases A programming language like Java, C++, VB A forgiving syntax A silver bullet Something to be afraid of A replacement for HTML A replacement for relational databases A programming language like Java, C++, VB A forgiving syntax A silver bullet
Text File Format IDLnameFnameGenderEthnicity 83492ClarkBettyFW 89430BhattSohamMA 94032JonesJimMW 48392KleinKimFB IDLnameFnameGenderEthnicity 83492ClarkBettyFW 89430BhattSohamMA 94032JonesJimMW 48392KleinKimFB
XML Format
Standard (Non-proprietary) Extensible Flexible Easy to share Web-friendly Separates content from presentation Richer than flat text files It will be everywhere Standard (Non-proprietary) Extensible Flexible Easy to share Web-friendly Separates content from presentation Richer than flat text files It will be everywhere Why should I care?
XML documents use a self-describing syntax All XML elements must have a closing tag XML tags are case sensitive All XML elements must be properly nested All XML documents must have a root element XML documents use a self-describing syntax All XML elements must have a closing tag XML tags are case sensitive All XML elements must be properly nested All XML documents must have a root element XML Syntax W3C:
Microsoft IBM Oracle SAS SPSS Adobe SAP Microsoft IBM Oracle SAS SPSS Adobe SAP Who supports XML? Sun Microsystems BEA Business Objects Novell W3C Computer Associates PeopleSoft Sun Microsystems BEA Business Objects Novell W3C Computer Associates PeopleSoft Anyone who is a player in the computing world
Data Islands Oracle MS Excel MS Access HTML PDF MS Word Crystal
XML Data Sharing Oracle MS Word Crystal MS Excel SQL Server Dreamweaver MS Access DB2 XML
Text Versus XML Student Record Nick Roberts Main St Paradise, CA Student Record Nick Roberts Main St Paradise, CA Roberts Nick Main St Paradise CA Roberts Nick Main St Paradise CA
HTML Versus XML Student Record Nick Roberts Main St Paradise, CA Student Record Nick Roberts Main St Paradise, CA Roberts Nick Main St Paradise CA Roberts Nick Main St Paradise CA
What is XML Schema? An XML schema describes the structure of an XML document An XML schema defines: Elements that can appear in a document Attributes that can appear in a document Which elements are child elements The order of child elements The number of child elements Whether an element is empty or can include text Data types for elements and attributes Default and fixed values for elements and attributes An XML schema describes the structure of an XML document An XML schema defines: Elements that can appear in a document Attributes that can appear in a document Which elements are child elements The order of child elements The number of child elements Whether an element is empty or can include text Data types for elements and attributes Default and fixed values for elements and attributes W3C:
So, What is XML Schema? An XML schema manages the expectations of those sharing an XML document The sender can describe the data in a way that the receiver can understand A schema enforces business constraints and ensures data validation For example, we can create a standard definition for social security number (data type is string, format=###-##-####, required field, etc.). An XML schema manages the expectations of those sharing an XML document The sender can describe the data in a way that the receiver can understand A schema enforces business constraints and ensures data validation For example, we can create a standard definition for social security number (data type is string, format=###-##-####, required field, etc.). W3C:
<xsd:element name="ID" minOccurs="1" od:jetType="text“ od:sqlSType="nvarchar" od:nonNullable="yes"> <xsd:element name="ID" minOccurs="1" od:jetType="text“ od:sqlSType="nvarchar" od:nonNullable="yes"> XML Schema Example
What is XSL? XSL stands for eXtensible Stylesheet Language Think of XSL as a set of languages that can: Transform XML into XHTML Filter and sort XML data Define parts of an XML document Format XML data based on the data value, like displaying negative numbers in red Output XML data to different media, like web browsers, screens, paper, or voice. XSL stands for eXtensible Stylesheet Language Think of XSL as a set of languages that can: Transform XML into XHTML Filter and sort XML data Define parts of an XML document Format XML data based on the data value, like displaying negative numbers in red Output XML data to different media, like web browsers, screens, paper, or voice. W3C:
Student Record, Student Record, XSL Example
XML Document XML Workflows Database Text or XML Editor Schema Validation Stylesheet Transformation XML Document Print Document Web Browser Database XML Application
XML Document XML Workflow Example Database ASP.NET XSL Stylesheet Web Browser
Questions? Comments? Angry Outbursts? The End