XML - PowerPoint PPT Presentation

1 / 38
About This Presentation
Title:

XML

Description:

hamburger lowfat='dream on' name CowBurger /name description Greasy and good. ... attribute type='lowfat' maxOccurs='1' / /ElementType ... – PowerPoint PPT presentation

Number of Views:46
Avg rating:3.0/5.0
Slides: 39
Provided by: ahmets4
Category:
Tags: xml | lowfat

less

Transcript and Presenter's Notes

Title: XML


1
XML
  • Ahmet Sentürk
  • CmpE-587

2
Content
  • XML
  • XML Syntax
  • XML Core Technologies
  • WebDAV
  • XML Web Services

3
What is XML
  • self-describing documents
  • textual markup (tags)
  • a simplified version of SGML
  • more suitable for use on the Web
  • HTML provides rich facilities for display, it
    does not provide any standards-based way to
    manage data as data
  • XML provides a data standard that can encode the
    content, semantics, and schemata for a wide
    variety of cases
  • offers a universal way to describe and work with
    data

4
Benefits Of XML
  • provides a universal ,powerful, flexible format
    for expressing data
  • data delivered to the desktop can be manipulated
    locally
  • Unicode
  • a description of the structure of the data
  • the data is now separate from the presentation
  • XML offers a mechanism for adding meta-data or
    meta-content to HTML
  • enables wide array of business applications to be
    implemented on the Internet

5
XML Syntax
  • for describing your data
  • ltbook nameThe Lord Of The Rings" lowfat"J.R.R.
    Tolkien"/gt
  • begin and end tags and attributes
  • case-sensitive
  • text-based (similar to HTML)
  • white space
  • considered well-formed if it contains exactly one
    root element and all the child elements are
    nested properly within each other

6
XML Syntax
  • store and transmit data
  • an unlimited set of tags
  • Strictly a Tree
  • An example well-formed XML document
  • lt?xml version"1.0"?gt
  • lthamburgersgt
  • lthamburger lowfat"dream on"gt
    ltnamegtCowBurgerlt/namegt ltdescriptiongtG
    reasy and good.lt/descriptiongt
    ltpricegt2.99lt/pricegt lt/hamburgergt
  • lt/hamburgersgt

7
XML Namespaces
  • provide a context for your XML document elements
  • resolve elements to a particular implementation
    semantic
  • Price Sale price or purchase price
  • lt?xml version"1.0"?gt
  • lthamburgers
  • xmlnspurchase"http//fastfood.org/franchise/pr
    ices" xmlnssales"http//fastfood.org/custome
    r/prices"gt
  • lthamburger lowfat"dream on"gt
  • ltnamegtCowBurgerlt/namegt
  • ltdescriptiongtGreasy and good.lt/descriptiongt
    ltpurchasepricegt0.99lt/pricegt
  • ltsalespricegt2.99lt/pricegt
  • lt/hamburgergt
  • lt/hamburgersgt

8
XML Core Technologies
  • Validation Technologies
  • Schemas
  • a formal specification of the rules of an XML
    document
  • Document Type Definitions
  • lt!DOCTYPE hamburgers SYSTEM "hamburger.dtd"gt

9
Hamburger.dtd
  • lt!ELEMENT hamburgers(hamburger)gt
  • lt!ELEMENT hamburger(name, description, price)gt
  • lt!ATTLIST hamburgerlowfat CDATA IMPLIEDgt
  • lt!ELEMENT name(PCDATA)gt
  • lt!ELEMENT description(PCDATA)gt
  • lt!ELEMENT price(PCDATA)gt
  • PCData (parsed character data)

10
XML Core Technologies
  • XML-Data
  • lt?xml version"1.0"?gt
  • ltSchema xmlns"schemas-microsoft-comxml-data"gt
  • ltElementType name"name" /gt
  • ltElementType name"description" /gt
  • ltElementType name"price" /gt
  • ltAttributeType name"lowfat" /gt
  • ltElementType name"hamburger" /gt
  • ltelement type"name" maxOccurs"1" /gt
  • ltelement type"description" maxOccurs"1" /gt
  • ltelement type"price" maxOccurs"1" /gt
  • ltattribute type"lowfat" maxOccurs"1" /gt
  • lt/ElementTypegt
  • ltElementType name"hamburgers" model"closed"gt
  • ltelement type"hamburger" maxOccurs"" /gt
  • lt/ElementTypegt
  • lt/Schemagt

11
XML Core Technologies
  • Processor (API) Technologies
  • DOM
  • in-memory tree representation of the XML document

12
XML Core Technologies
  • Processor (API) Technologies
  • SAX
  • event-driven XML parsing
  • doesn't require the entire XML file to be loaded
    into memory
  • event handlers to just-in-time process

13
XML Core Technologies
  • Transformation Technologies
  • XSL Patterns
  • /hamburgers/hamburger_at_lowfat"yes"/price
  • XSL
  • XML File
  • lt?xml version"1.0"?gt
  • lthamburgersgt
  • lthamburger lowfat"dream on"gt
    ltnamegtCowBurgerlt/namegt ltdescriptiongtGreasy
    and good.lt/descriptiongt ltpricegt2.99lt/pricegt
  • lt/hamburgergt
  • lt/hamburgersgt

14
XML Core Technologies
  • XSL Transformation
  • lt?xml version"1.0"?gt
  • ltxslstylesheet xmlnsxslhttp//www.w3.org/TR/W
    D-xsl "gt
  • ltxsltemplate match"/"gt
  • lthtmlgt
  • ltbodygt
  • lth1gthamburgerslt/h1gt
  • ltxslfor-each select"hamburgers_at_lowfat"dream
    on"gt ltligtltxslvalue-of
    select"name"/gt, ltxslvalue-of select"price"/gt,
  • ltxslvalue-of select"description"/gtlt/ligt
  • lt/xslfor-eachgt
  • lt/bodygt
  • lt/htmlgt
  • lt/xsltemplategt
  • lt/xslstylesheetgt

15
XML Core Technologies
  • HTML Output
  • lthtmlgt
  • ltbodygt
  • lth1gthamburgerslt/h1gt
  • ltolgt
  • ltligtCowBurger, 2.99, Greasy and good.lt/ligt
  • lt/olgt
  • lt/bodygt
  • lt/htmlgt

16
XML Core Technologies
  • Linking Technologies
  • XLink
  • lthamburger xmllink"simple" HREF
    "http//fastfood.org/hamburger.htm"gtlt/hamburgergt
  • XPointer
  • child(2,hamburger)
  • Other Technologies
  • Mathematical Markup Language (MathML)
  • Synchronized Multimedia Integration Language
    (SMIL)
  • Vector Markup Language (VML)

17
WebDAV
  • Web Distributed Authoring and Versioning
  • Communicating XML Data over the Web
  • an important communication protocol for the Web
    as an extension to HTTP 1.1
  • useful in client/server architecture

18
WebDAV
  • Protocol Problem
  • HTTP for static documents intended for viewing
  • lost update problem
  • Three major major concerns of collaborative
    authoring in WebDAV
  • Overwrite Protection
  • Resource Management
  • Document Properties

19
The Format of WebDAV Requests
  • set of methods that clients can use to
    communicate with servers
  • Options, Head, and Trace
  • Get
  • Put and Post
  • Delete
  • Mkcol
  • PropFind and PropPatch
  • Copy and Move
  • Lock and Unlock

20
What XML Means to WebDAV
  • HTTP communicate with headers
  • WebDAV require a great deal of information to be
    associated with both requests and responses
  • Because of its inherent extensibility, XML was
    chosen to describe how these instructions are
    communicated
  • A method of formatting instructions describing
    how data is to be handled.
  • A method of formatting complex responses from the
    server.
  • A method of communicating customized information
    about the collections and resources handled.
  • A flexible vehicle for the data itself.

21
XML Web Services
  • fundamental building blocks in the move to
    distributed computing on the Internet
  • communication and collaboration among people and
    applications
  • application integration
  • constructed using multiple XML Web services
  • from various sources
  • work together
  • regardless of where they reside or how they were
    implemented
  • primary advantages
  • allows programs written in different languages on
    different platforms to communicate with each
    other in a standards-based way

22
XML Web Services
  • many definitions
  • XML Web Services expose useful functionality to
    Web users through a standard Web protocol, SOAP.
  • XML Web services provide a way to describe their
    interfaces in enough detail to allow a user to
    build a client application to talk to them,
    called a Web Services Description Language (WSDL)
    document
  • XML Web services are registered so that potential
    users can find them easily, with Universal
    Discovery Description and Integration (UDDI).

23
What Can I Do With XML Web Services
  • information sources that you could easily
    incorporate into applications
  • more powerful applications that use XML Web
    services as building blocks

24
SOAP
  • communication protocol for XML Web services
  • defines the XML format for messages
  • Remote Procedure Calls
  • SOAP message containing a callable function
  • parameters to pass to the function, is sent from
    the client
  • server returns a message with the results of the
    executed function
  • define security for web services

25
Why Should I Use SOAP?
  • implemented on many different hardware and
    software
  • can be used to link separate systems
  • RPC
  • HTTTP

26
WSDL
  • a WSDL file is an XML document that describes a
    set of SOAP messages and how the messages are
    exchanged
  • based on the XML Schema
  • defines where the service is available and what
    communications protocol is used to talk to the
    service

27
WSDL Document Structure
  • Abstract Definitions (define SOAP messages )
  • Types Machine- and language-independent type
    definitions
  • Messages Contains function parameters or
    documentdescripttions
  • PortTypes function signatures (operation name,
    input parameters, output pameters
  • Concrete Descriptions
  • Bindings Specifies binding(s) of each operation
  • Services Specifies port address(es) of each
    binding, syntax for calling methods

28
UDDI
  • yellow pages of Web services
  • Search web service
  • Read about it
  • Get more information about service
  • to reach a significant market, you need UDDI
  • an XML file that describes a business and the
    services it offers

29
UDDI
  • 3 parts of an entry in UDDI
  • white pages describe the company offering the
    service
  • yellow pages include industrial categories
  • green pages describe the interface to the
    service
  • UDDI directory includes several ways to search
    for the services

30
What XML Do You Post?
  • SOAP Envelope
  • lt?xml version'1.0' encoding'UTF-8'?gt
  • ltEnvelope xmlns'http//schemas.xmlsoap.org/soap/
    envelope/'gt
  • ltBodygtlt/Bodygt
  • lt/Envelopegt
  • Contents of body can be any query
  • ltfind_business generic"1.0" xmlns"urnuddi-org
    api"gt ltnamegtMicrosoftlt/namegt
  • lt/find_businessgt

31
How Do You Post the XML?
  • Form a Jscript file or HTML page by XMLHTTP
  • http new ActiveXObject("Microsoft.XMLHTTP")
    http.open("POST", url, false)
    http.setRequestHeader("Accept","text/xml")
    http.setRequestHeader("Cache-Control","no-cache")
    http.setRequestHeader("SOAPAction",'""')
    http.send(msg)

32
What Do You Get Back?
  • XML of course
  • ltbusinessList generic"1.0" operator"Microsoft
    Corporation" truncated"false"
    xmlns"urnuddi-orgapi"gt
  • ltbusinessInfosgt
  • ltbusinessInfo businessKey"0076B468-EB27-42E5-AC
    09-9955CFF462A3"gt
  • ltnamegtMicrosoft Corporationlt/namegt
  • ltdescription xmllang"en"gtEmpowering people
    through great software - any time, any place
    and on any device is Microsofts vision. As the
    worldwide leader in software for personal and
    business computing, we strive to produce
    innovative products and services that meet our
    customer's lt/descriptiongt
  • ltserviceInfosgt
  • ltserviceInfo businessKey"0076B468-EB27-42E5-AC
    09-9955CFF462A3" serviceKey"1FFE1F71-2AF3-45FB-
    B788-09AF7FF151A4"gt
  • ltnamegtWeb services for smart searchinglt/namegt
    lt/serviceInfogt

33
.NET application architecture
  • multiple Web Services that work together to
    provide data and services for the application

34
Generic Architecture for a Web Service
35
Reliable XML Web Services
  • Standards Based
  • Acknowledged Delivery
  • Ordered Delivery
  • Symmetric Conversations
  • Promotes Asynchronous Processing

36
Synchronous Messaging
  • The connection may be broken by an external
    source, dropping either the request or response
  • The server may timeout because it is offline or
    overloaded
  • The server process may be dependant upon down
    stream services that have uncontrollable response
    times.

37
Synchronous Messaging
38
Asynchronous Model
Write a Comment
User Comments (0)
About PowerShow.com