ELEC3609 Week 6 XML - PowerPoint PPT Presentation

1 / 28
About This Presentation
Title:

ELEC3609 Week 6 XML

Description:

XML lets you define schemas for tag-based languages ('markup language' ... and identifying the type of each component (e.g., verb, adjective, or noun) ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 29
Provided by: eelabU
Category:
Tags: xml | adjective | elec3609 | week

less

Transcript and Presenter's Notes

Title: ELEC3609 Week 6 XML


1
ELEC3609 Week 6 XML
  • XML is a language for creating other languages!
  • XML lets you define schemas for tag-based
    languages (markup language)
  • XML allows you to extend any existing language
    (schema) with your own tags (ergo, eXtensible)
  • Examples of XML schemas
  • financial transactions (stock transactions)
  • business documents (purchase order, invoice)
  • remote procedure calls (SOAP)
  • configuration files (security, server properties)

2
World Wide Web Consortium (W3C)http//www.w3c.org
/
3
XML Working Group
  • W3C formed XML Working Group 1996 with these
    design goals
  • XML shall be straightforwardly usable over the
    Internet
  • XML shall support a wide variety of applications
  • XML shall be compatible with SGML
  • It shall be easy to write programs which process
    XML documents
  • The number of optional features in XML is to be
    kept to the absolute minimum, ideally zero
  • XML documents should be human-legible and
    reasonably clear
  • The XML design should be prepared quickly
  • The design of XML shall be formal and concise
  • XML documents shall be easy to create
  • Terseness in XML markup is of minimal importance

4
XML History
  • XML 1.0 became a standard (W3C recommendation) on
    10 February 1998
  • effort grew out of experience with SGML
  • cooperation between various W3C member
    organizations (including Microsoft, Sun, IBM, HP,
    Adobe)
  • XML 1.1 became a standard (W3C recommendation) on
    4 February 2004
  • less rigid constraints on names
  • addresses issues involving character sets

5
(No Transcript)
6
(No Transcript)
7
Application Integration
8
Application Integration
9
Application Integration
10
Platform-Independent Services
  • In the past, functionality was exposed to remote
    clients via various remote object standards
  • COM/DCOM
  • CORBA
  • Java RMI
  • Using these remote objects required a significant
    investment in a platform
  • Web Services provide a new way to expose
    functionality
  • use XML and XML data types for transport
  • work with any platform
  • provide a bridge to existing business services

11
XML 1.1
12
XML Declaration
13
DOCTYPE
14
Elements
15
Element
16
Attributes
17
Attributes
  • Name
  • Must start with letter or underscore and can
    contain only letters, numbers, hyphens, periods,
    and underscores
  • Value
  • Can be of several types, but is almost always a
    string
  • Must be quoted
  • title"Lecture 2
  • match'item"baseball bat"'
  • Cannot contain lt or (by itself)
  • PCDATA
  • Text that appears as the content of an element

18
Entities
19
CDATA
20
Comments
21
Processing Instructions
22
Event-Based Parsing
23
Parsing
  • In linguistics, to divide language into small
    components that can be analyzed. For example,
    parsing this sentence would involve dividing it
    into words and phrases and identifying the type
    of each component (e.g., verb, adjective, or
    noun)
  • For XML, parsing means reading an XML document,
    identifying the various components, and making it
    available to an application

24
Grammars in Backus-Naur Form
  • In order to parse a document, you need to be able
    to specify exactly what it contains
  • XML specification does this for XML using a
    grammar in Backus-Naur Form (BNF)
  • A grammar describes a language through a series
    of rules
  • A rule describes how to produce a something
    (e.g., a start tag) by assembling characters and
    other non-terminal symbols
  • Made up of
  • non-terminal symbols
  • terminal symbols (data that is taken literally)

25
Arithmetic
26
A grammar for XML
where Name is one or more characters excluding gt
and CharData is zero or more characters excluding
lt.
27
Tokenizing and Recognizing
  • Tokenizing Creates tokens from the character
    stream
  • Element name, equal sign, start tag
  • Recognizing Understands the syntax of the
    document and checks for orrectness
  • Builds a syntax tree

28
recursive descent parsing
  • XML's grammar works well with a parsing technique
    known as recursive descent parsing. Basically
  • You write a function that is responsible for
    parsing every non-terminal in the grammar
  • You assume that the document matches the grammar
  • The correct alternation in a rule can be
    determined by examining a few tell-tale starting
    characters
  • You recursively parse the document, calling each
    non-terminal parsing function as dictated by the
    grammar
  • Use exception handling to handle errors when they
    occur deep in the recursive call tree
Write a Comment
User Comments (0)
About PowerShow.com