XML – Extensible Markup Language
XML eXtensible – add to language. Markup – delimit info using tags. Language – a way to express info.
Major Roles for XML
Store Data XML Schema XML Document
XML Schema Exchange Data XML Document
Present Info XSL Stylesheet 1 XSL Stylesheet 2 XML Document Client Access to XML Data
Simplify Data Capture (eventually) Database Data encapsulation into data node Insert data node
XML Includes … XForms Model XHTML XPath XSLT XSL-FO XForms Processor XSL Parser Rendering Agent XSD HTML Marked up text
XML Documents -
An XML Document … A text document. Stores data. Data items are delimited using tags. Hierarchical structure. -
5003 Jane Tags: Delimit data. Show meaning. You make tags! Data: Rich data types. Constraints.
Well Formed XML 1.All data items are between tags. 2.Closing tags start with /. 3.Tags are case sensitive. 4.No spaces or symbols in tags. (Data may contain spaces and some symbols.) 5.Tags balance.
Tags and Data 5003 Jane
Well Formed? Homer Simpson
XML Document Structure Transaction TDate Amt 1/1/ Transaction TDate Amt 1/7/ Customer Id CName 5004 Tom Customer Id CName 5003 Jane Customers Transaction TDate Amt 1/3/ Jane Tom
Hierarchy of Nodes Transaction TDate Amt 1/1/ Transaction TDate Amt 1/7/ Customer Id CName 5004 Tom Customer Id CName 5003 Jane Transaction TDate Amt 1/3/ Customers / Root Node Document Element or Document Node Node or Complex Element (Simple) Element
Key to Understanding? Meaningful, descriptive tag names!
XML Schemas
An XML Schema … Defines the structure of an XML document. –Nodes. –Hierarchy. Defines the elements in each node. –Tag. –Data type. –Constraints. XML Schema XML Document
Valid XML Document XML Schema XML Document Well formed. XML document conforms to structure defined in XML schema.
XML Schema XML Schema - Exchange Data XML Document Based on Standards
Defining an XML Schema Identify Data Requirements Specify Tags Specify Structure Agree on Definitions
Some Major XML Standards EFT Direct Deposit Open Financial Exchange (OFX) EDI XML/EDI and electronic business using XML (ebXML) eXtensible Business Reporting Language (XBRL) Financial Reporting Tax Reporting IRS e-file Standards
5003 Jane Tom Transaction TDate Amt 1/1/ Transaction TDate Amt 1/7/ Customer Id CName 5004 Tom Customer Id CName 5003 Jane Transaction TDate Amt 1/3/ Customers
Transaction TDate Amt 1/1/ Transaction TDate Amt 1/7/ Customer Id CName 5004 Tom Customer Id CName 5003 Jane Transaction TDate Amt 1/3/ Customers
… Transaction TDate Amt 1/1/ Transaction TDate Amt 1/7/ Customer Id CName 5004 Tom Customer Id CName 5003 Jane Transaction TDate Amt 1/3/ Customers
… Transaction TDate Amt 1/1/ Transaction TDate Amt 1/7/ Customer Id CName 5004 Tom Customer Id CName 5003 Jane Transaction TDate Amt 1/3/ Customers
Validating XML Documents Use software or web tools. –Topologi Schematron Validator. –GotDotNet Schema Validator.
XSL Stylesheet, etc.
An XSL Stylesheet … Gets and filters nodes in an XML document. Transforms nodes. Formats output.
Many XSL Stylesheets XSL Stylesheet #1 XSL Stylesheet #2 XML Document
XSL Stylesheet “Languages” XML Path XPath: gets nodes using paths and filtering patterns. XSL Transformations XSLT: transforms a document tree into a new document tree. XSL-Formatting Objects XSL-FO: describes how output looks. (HTML on steroids!)
+= Parsed and Rendered Output XML Document XSL Stylesheet
<xsl:stylesheet xmlns:xsl=" version="1.0"> Customer Information Id: Name: Date: Amount: Transaction TDate Amt 1/1/ Transaction TDate Amt 1/7/ Customer Id CName 5004 Tom Customer Id CName 5003 Jane Transaction TDate Amt 1/3/ Customers
Alphabet Soup of Xtechs XML Schema XML Document XForms XForms Model XSL Stylesheet XHTML Marked up textXPath XSLT XSL-FO XForms Processor Editor & Validator XSL Parser Rendering Agent XSD Languages & Formats Software HTML