190 likes | 319 Views
Topics. To define XML as a technology To place XML in the context of system architectures Online support: http://www.w3schools.com/xml/default.asp Online community: http://www.oasis-open.org/home/index.php Standards development: http://www.oasis-open.org/committees/committees.php#completed.
E N D
Topics • To define XML as a technology • To place XML in the context of system architectures Online support: http://www.w3schools.com/xml/default.asp Online community: http://www.oasis-open.org/home/index.php Standards development: http://www.oasis-open.org/committees/committees.php#completed CIS 340
Spectrum of “Technologies” DTD XPATH XSD XML XQUERY XSL XSLT XLINK XFORMS XSL-FO XPOINTER CIS 340
XML • XML stands for eXtensible Markup Language. • XML is designed to transport and store data. • XML is important to know, and very easy to learn. CIS 340
XML ... • Is a syntax for describing data • Almost any data • Produces “vocabularies” • Anyone can produce an individualized vocabulary • Sharing the vocabulary enables the sharing of data Organizational hub • http://www.xml.org/ CIS 340
XML History • Shares similar historical roots with HTML • Part of SGML (Standard Generalized Markup Language – 1970s) • HTML describes how to render information via a browser • “rendering” options are fixed via the language • Display potential fixed via the selected output technology HTML limitation? • Interpretation after transmission (e.g. use) requires human intervention CIS 340
A-WEB FINANCIAL.rpt COMPANY B COMPANY A XML History (p. 2) • If XML used, Company B can: • Have programs manipulate data • Import data directly to database • Store immediately within similar, affiliated documents • Manipulate data for specific needs • continues.... • XML enables human bypass • XML offers self-descriptive labels equating to interpretation • XML provides “meta information” CIS 340
Def: Vocabularies • Collection of elements • Not predefined • But related into a structure vocabulary • “Instance of” XML document CIS 340
Accounting XML Advertising XML Astronomy XML Building XML Chemistry XML Construction XML Education XML Food XML Finance XML Government XML Healthcare XML Human Resources XML Instruments XML Insurance XML Legal XML Manufacturing XML News XML Photo XML Physics XML Publishing XML Real Estate XML Telecommunications XML Travel XML Sample Defined Vocabularies (in progress) CIS 340
EX: Address Vocabulary Contents of the files? .../xml/... CIS 340
Prolog (optional) Describes the xml-specification Declares the document type (DTD) Body (required) collection of instantiated vocabulary terms Epilog (optional) processing or comments <?xml version = 1.0”?> <!DOCTYPE book SYSTEM “book.dtd”> <book category = “FICTION”> <title>Golden Phoenix</title> <author>J. K. Rowling</author> </book> <book category = “NON-FICTION”> <title>Mythical Work</title> <author>E. Yourdan</author> </book> XML Document CIS 340
Schemas • Document Type Definition (DTD) • XML Schema Definition (XSD) • Offers the legal structure of the elements of a vocabulary • Enables the programmatic access of an XML “document” • Meaning? • Declare element types • Qualify elements with attributes • Define parent-child relationships • Assign simple data types • Establish validation basis for data acceptance CIS 340
DTD !DOCTYPE note defines that the root element of this document is note !ELEMENT note defines that the note element contains four elements: to,from,heading,body" !ELEMENT to defines the to element to be of type "#PCDATA" !ELEMENT from defines the from element to be of type "#PCDATA" !ELEMENT heading defines the heading element to be of type "#PCDATA" !ELEMENT body defines the body element to be of type "#PCDATA" CIS 340
EX: DTD Specification <!DOCTYPE book [ <!ELEMENT book (title, author)> <!ATTLIST book CATEGORY (Fiction |Non-Fiction)> <!ELEMENT title (#PCDATA)> <!ELEMENT author (#PCDATA)> ]> CIS 340
address example <?xml version = “1.0”?> <xsd:schema xmlns:xsd= http://www.w3.org/2001/XMLSchema> <xsd:element name=“book”> <xsd:complexType> <xsd:sequence> <xsd:element name=“title” type “xsd:string”/> <xsd:element name=“author” type “xsd:string”/> </xsd:sequence> <xsd:attribute name = “category”> <xsd:simpleType> <xsd:restriction base=“xsd:string”/> <xsd:enumeration value = “Fiction”/> <xsd:enumeration value = “Non-Fiction”/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> </xsd:element> </xsd:schema> EX: XSD Specification(see p. 29)
XQUERY ... FLWR (“flower”) • Query language • aka SQL • Designed for XML documents • Allows for logic to be used to access embedded information of XML documents CIS 340
XQUERY ... FLWR (“flower”) FLWR :: For Let Where Return General versions: for Variable in Exp where Exp return Exp sortby(Exp) let Variable := Exp where Exp return Exp sortby(Exp) for $x in document (“books.xml”) // book where $x/author = “J. K. Rowling” return $x/title gives<title>Golden Phoenix</title> CIS 340
XSLT XML Stylesheet Language Transformations Mechanism for taking XML documents to different output renditions XPATH Collection of “utility functions” Enables the parsing and traversing of XML structures Required mechanism for XSLT and XQUERY Not defined via an XML-compliant syntax Most XML languages are Connective Languages CIS 340
Highlights CIS 340