XML, XSL, and SOAP Building Object Systems from Documents CSC/ECE 591o Summer 2000
Copyright © 2000, Sandeep Singhal New Web Technologies Technologies under development by the World Wide Web Consortium (W3C) See Standards for Web-based documents XML: Extensible Markup Language XSL: Extensible Stylesheet Language SOAP: Simple Object Access Protocol Other technologies: XML Pointer, XML Fragments, XML Schema, Resource Description Framework (RDF)…
Copyright © 2000, Sandeep Singhal XML, the Extensible Markup Language Structured meta-data language Derived from SGML (Simple Generalized Markup Language) Same heritage as HTML, so looks similar Used to describe any type of information in a machine-readable way
Copyright © 2000, Sandeep Singhal Components of XML DTD (Document Type Definition) Description of valid XML document syntax (elements and structure) Element XML document component Example: … Example: CDATA: Text inside an element Comments: Tags:,, Processing instructions:
Copyright © 2000, Sandeep Singhal Example XML Document Hello, world!
Copyright © 2000, Sandeep Singhal Example DTD
Copyright © 2000, Sandeep Singhal A More Complex DTD
Copyright © 2000, Sandeep Singhal XSL – Extensible Stylesheet Language XSL is a language for expressing stylesheets (XSL:T) A language for transforming XML documents An XML vocabulary for specifying formatting semantics (under development) An XSL stylesheet specifies the presentation of a class of XML documents by describing how an instance of the class is transformed into an XML document that uses the formatting vocabulary
Copyright © 2000, Sandeep Singhal Thinking of XSL Model the XML document as a “tree” XSL document is a list of node “patterns” and “actions” Search XML tree for matching patterns and apply corresponding actions Result is target document
Copyright © 2000, Sandeep Singhal A Simple XSL Example <xsl:stylesheet version="1.0“ xmlns:xsl=" xmlns="
Copyright © 2000, Sandeep Singhal Applying the Example Document Title Chapter Title Document Title Chapter Title
Copyright © 2000, Sandeep Singhal Defining an “area” of the Tree Types of relationships Child Sibling Parent Descendant Ancestor Root
Copyright © 2000, Sandeep Singhal Examples of Template Matching para (element match) * (any element) chapter|appendix (either/or) olist/item (parent/child) appendix//para (ancestor/child) / (root) id(“W11”) (any node with ID W11) para[1] (para element that is first child) para[last()=1] (only para child) para[position()>1] (not first para child) para[position() mod 2=1] (odd numbered child para)
Copyright © 2000, Sandeep Singhal Content Generation Among the things you can do: Generate numbered lists Create XML processing instructions Apply variables and dynamic values Create comments Sort
Copyright © 2000, Sandeep Singhal Uses of XSL Convert XML data Into HTML, WML, VoiceXML, etc. One XSL document per target format Single input document Bridge disparate systems EDI Legacy integration
Copyright © 2000, Sandeep Singhal SOAP: Simple Object Access Protocol Developed by IBM, Microsoft, Lotus, DevelopMentor, and UserLand Software Lightweight protocol for exchanging information in a decentralized distributed environment XML description of an RPC call Implementation could be RMI or ActiveX or something else Represents an alternative to IIOP Uses HTTP to transport request/response
Copyright © 2000, Sandeep Singhal Document Structure (mandatory) [Describes SOAP message type] (optional): Includes processing instructions for the request (mandatory): Describes the parameters Fault: Includes error codes
Copyright © 2000, Sandeep Singhal SOAP Example Request HOST /StockQuote HTTP/1.1 Host: Content-Type: text/xml; charset=“utf-8” Content-Length: nnnn SOAPAction: “Some-URI” <SOAP-ENV:Envelope xmlns:SOAP-ENV= SOAP-ENV:encodingStyle= DIS
Copyright © 2000, Sandeep Singhal SOAP Example Response HTTP/ OK Content-Type: text/xml; charset=“utf-8” Content-Length: nnnn <SOAP-ENV:Envelope xmlns:SOAP-ENV= SOAP-ENV:encodingStyle= 34.5
Copyright © 2000, Sandeep Singhal Another SOAP Example … <SOAP-ENV:Envelope xmlns:SOAP-ENV= SOAP- ENV:encodingStyle= <t:Transaction xmlns:t=“some-URI” SOAP-ENV:mustUnderstand=“1”> 5 IBM Yes
Copyright © 2000, Sandeep Singhal Some Other Capabilities Encoding Can define structures, arrays, enumerations, and other basic data types Transmission Use standard HTTP 1.1 Use HTTP Extension Framework