1 / 21

Demystifying the eXtensible Markup Language

Nick Roberts & Jim Few http://ir.kennesaw.edu. Demystifying the eXtensible Markup Language. Agenda. What is XML? Why should I care? How can I use XML?. What is XML?. The eXtensible Markup Language (XML) is a markup language that provides a format for describing structured data.

zaynah
Download Presentation

Demystifying the eXtensible Markup Language

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Nick Roberts & Jim Few http://ir.kennesaw.edu Demystifying the eXtensible Markup Language

  2. Agenda • What is XML? • Why should I care? • How can I use XML?

  3. 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. W3C: http://www.w3schools.com/xml/xml_whatis.asp

  4. 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

  5. Text File Format ID Lname Fname Gender Ethnicity 83492 Clark Betty F W 89430 Bhatt Soham M A 94032 Jones Jim M W 48392 Klein Kim F B

  6. XML Format

  7. Why should I care? • Standard (Non-proprietary) • Extensible • Flexible • Easy to share • Web-friendly • Separates content from presentation • Richer than flat text files • It will be everywhere

  8. XML Syntax • 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 W3C: http://www.w3schools.com/xml/xml_syntax.asp

  9. Who supports XML? • Microsoft • IBM • Oracle • SAS • SPSS • Adobe • SAP • Sun Microsystems • BEA • Business Objects • Novell • W3C • Computer Associates • PeopleSoft Anyone who is a player in the computing world

  10. Oracle PDF Crystal MS Excel MS Access MS Word HTML Data Islands

  11. Oracle DB2 MS Word Crystal MS Excel MS Access SQL Server Dreamweaver XML Data Sharing XML

  12. Text Versus XML Student Record Nick Roberts 0001462395 143 Main St Paradise, CA 90210 24 3.4 3.8 <Student> <Last-Name>Roberts</Last-Name> <First-Name>Nick</First-Name> <ID>0001462395</ID> <Street>143 Main St</Street> <City>Paradise</City> <State>CA</State> <Zip-Code>90210</Zip-Code> <Age>24</Age> <GPA-Cumulative>3.4</GPA-Cumulative> <GPA-Term>3.8</GPA-Term> </Student>

  13. HTML Versus XML <b>Student Record</b> <br> <br> Nick Roberts<br> 0001462395<br> 143 Main St<br> Paradise, CA<br> 90210<br> 24 <Student> <Last-Name>Roberts</Last-Name> <First-Name>Nick</First-Name> <ID>0001462395</ID> <Street>143 Main St</Street> <City>Paradise</City> <State>CA</State> <Zip-Code>90210</Zip-Code> <Age>24</Age> </Student>

  14. 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 W3C: http://www.w3schools.com/schema/schema_why.asp

  15. 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.). W3C: http://www.w3schools.com/schema/schema_intro.asp

  16. XML Schema Example <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"xmlns:od="urn:schemas-microsoft-com:officedata"> <xsd:element name="ID"minOccurs="1"od:jetType="text“ od:sqlSType="nvarchar"od:nonNullable="yes"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="9" /> </xsd:restriction> </xsd:simpleType> </xsd:element> </xs:schema>

  17. 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. W3C: http://www.w3schools.com/xsl/xsl_languages.asp

  18. XSL Example <xsl:stylesheetversion="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <strong>Student Record</strong> <br/> <br/> <xsl:value-of select="Student/First-Name"/> <xsl:value-of select="Student/Last-Name"/> <br/> <xsl:value-of select="Student/Street"/> <br/> <xsl:value-of select="Student/City"/>, <xsl:value-of select="Student/State"/> <xsl:value-of select="Student/Zip-Code"/> <br/> <xsl:value-of select="Student/Age"/> </body> </html> </xsl:template> </xsl:stylesheet>

  19. Database Database Text or XML Editor XML Application XML Workflows XML Document XML Document Schema Validation Print Document Web Browser Stylesheet Transformation

  20. XML Workflow Example Database Web Browser ASP.NET XML Document XSL Stylesheet

  21. The End Questions? Comments? Angry Outbursts? http://ir.kennesaw.edu

More Related