Advanced Multimedia Tech. eXtensible Mark-up Language Part I - PowerPoint PPT Presentation

Loading...

PPT – Advanced Multimedia Tech. eXtensible Mark-up Language Part I PowerPoint presentation | free to download - id: 58bd7-ZDc1Z



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

Advanced Multimedia Tech. eXtensible Mark-up Language Part I

Description:

REVIEW Romantic setting, great place to go with a date /REVIEW /RESTAURANT /RESTAURANTS ... Graphics (SVG) RDF, XMI. Etc. ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 31
Provided by: profatale
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Advanced Multimedia Tech. eXtensible Mark-up Language Part I


1
Advanced Multimedia Tech. eXtensible Mark-up
Language Part I
Prof. A. Taleb-Bendiab Room 605 a.talebbendiab_at_liv
jm.ac.uk http//www.cms.livjm.ac.uk/taleb/lectures
/cmssem013
2
So far
  • Dr. R. Pereira Module Workplan Schedule

3
In this Session
  • Brief introduction to XML
  • Definitions
  • Examples
  • XML and DTD
  • Web applications
  • Tutorial session in Lab
  • Exercise
  • This lecture is based on Mr. Mark Allen Lecture
    Notes.

4
Web Page Example
5
HTML Code
  • lthtml gt
  • ltheadgt
  • ltmeta name"GENERATOR" content"Microsoft
    FrontPage 4.0"gt
  • ltmeta name"Microsoft Theme" content"global 101,
    default"gt
  • ltmeta name"Microsoft Border" content"tlrb,
    default"gt
  • lttitlegtHome Pagelt/titlegt lt/headgt
  • ltbody background"../../_themes/global/glotextb.gi
    f" bgcolor"FFFFCC" text"510000"
    link"999900" vlink"CC9966" alink"990066"gt
  • lttable border"0" cellpadding"0" cellspacing"0"
    width"100"gt
  • lttrgtlttdgtltfont face"Arial, Helvetica"gt
  • ltp align"center"gtltbrgt
  • ltfont size"4" face"Arial"gtStudent Learning
    Spacelt/fontgtlt/pgt
  • ltp align"center"gtlta href"../Default.htm"gtHomelt/a
    gtnbspnbsp lta href"../cmssem011/Module20speci
    fication.doc"gtModule
  • lta href"http//www.cms.livjm.ac.uk/markallen/mult
    i-media.htm"gtTutorialslt/agt lta href"../cmssem011/i
    ndicative_references.htm"gt Reading Listlt/agtlt/pgt
  • ltp align"left"gtltfont size"4"gtContemporary
    issues in IT Distributed Applications and
    E-Commerce ltemgtCMSCB3005lt/emgtltfont size"4"
    face"Arial"gtnbsplt/fontgtlt/fontgtlt/pgt
  • lt/htmlgt

6
Associated XML Code
  • lt?xml version"1.0"?gt gt
  • lt?xml-stylesheet type"text/xsl"
    href"..\xsl\ENR-change-table.xsl"?gt
  • lt!DOCTYPE Components SYSTEM "Project6.dtd"gt
  • ltheadgt
  • ltmeta name"Microsoft Theme" content"global 101,
    default"gt
  • lttitlegt Student Learning Space lt/titlegt lt/headgt
  • ltbodygt
  • ltmaingt
  • ltpage typehtml href"../Default.htm"gt
  • ltheadingsgt
  • ltheading 1 href"../cmssem011/Module20specifica
    tion.doc"gt
  • ltheading 2 href"http//www.cms.livjm.ac.
    uk/markallen/multi-media.htm"gt
  • ltheading 3 href"../cmssem011/indicative_referen
    ces.htm"gt
  • lt/headingsgt
  • lt/maingt
  • lt/bodygt
  • lt/xmlgt

7
What is XML?
  • XML is
  • an eXtensible Markup Language for describing both
    structured and unstructured information, which
    could be used on the web.
  • XML documents containing structured information
    including
  • Content words, pictures (vector graphics),
    e-commerce transactions, mathematical equations,
    object meta-data, server APIs, and other XML
    documents.
  • XML is a meta-language for defining other markup
    languages not like HTML or SGML
  • Unlike Html or SGML it provides
  • extensible tag semantics
  • a facility to define tags and the structural
    relationships between them.
  • All of the semantics of an XML document will
    either be defined by the applications that
    process them or by stylesheets.

8
XML System
  • An XML system consists of
  • XML Document
  • The content or information
  • Document Type Definition (DTD)
  • The structural definition
  • Defines the logical structure of the document
  • A Tree
  • XML Parser
  • Checks document for correctness.
  • Checks the document conforms to the DTD
  • XML Application
  • A program that does something useful with XML
    documents

9
An Example of XML Document
lt?xml version "1.0" ?gt lt!DOCTYPE RESTAURANTS
SYSTEM "restaurant.dtd"gt lt?xml-stylesheet
type"text/xsl" href"srt_restaurant.xsl"?gt lt!--
Define XSL Stylesheet to be used with current XML
Document --gt ltRESTAURANTSgt ltRESTAURANT
FOOD_GENRE"Chinese"gt ltNAMEgtYin
Yanglt/NAMEgt ltFOOD_RATINGgt4lt/FOOD_RATINGgt
ltAMBIANCE_RATINGgt2lt/AMBIANCE_RATINGgt
ltAVERAGE_MEAL_COSTgt6lt/AVERAGE_MEAL_COSTgt
ltREVIEWgtGreat food, but better to order take out
than to eat in.lt/REVIEWgt lt/RESTAURANTgt
ltRESTAURANT FOOD_GENRE"Italian"gt
ltNAMEgtLittle Italylt/NAMEgt
ltFOOD_RATINGgt3lt/FOOD_RATINGgt
ltAMBIANCE_RATINGgt4lt/AMBIANCE_RATINGgt
ltAVERAGE_MEAL_COSTgt8lt/AVERAGE_MEAL_COSTgt
ltREVIEWgtRomantic setting, great place to go with
a datelt/REVIEWgt lt/RESTAURANTgt lt/RESTAURANTSgt
10
How Is XML Defined?
  • XML document is defined by a number of related
    specifications
  • Extensible Markup Language (XML) 1.0
  • Defining the syntax of XML.
  • XML Pointer Language (XPointer) and XML Linking
    Language (XLink)
  • Defining a standard way to represent links
    between resources. In addition to simple links,
    like HTML's ltAgt tag, XML has mechanisms for links
    between multiple resources and links between
    read-only resources.
  • XPointer describes how to address a resource,
  • XLink describes how to associate two or more
    resources.
  • Extensible Style Language (XSL)
  • Defines the standard stylesheet language for XML.
  • XQL -- Defines a standard query language for XML.
  • XUL -- Defines a standard user-interface language
    for XML.

11
XML Markup 1
  • Six kinds of markup are used in XML documents
  • 1. Elements -- Delimited by angle brackets, most
    elements identify the nature of the content they
    surround.
  • It begins with a start-tag, ltelementgt, and ends
    with an end-tag, lt/elementgt.
  • Attributes -- Attributes are name-value pairs
    that occur inside start-tags after the element
    name.
  • ltdiv class"preface"gtis a div element with the
    attribute class having the value preface.
  • 2. entity references -- introduce markup into a
    document, some characters have been reserved to
    identify the start of markup.
  • entities are used to represent these special
    characters. Entities are also used to refer to
    often repeated or varying text and to include the
    content of external files.
  • Entity references begin with the ampersand and
    end with a semicolon.

12
XML Markup 2
  • For example, the lt entity inserts a literal lt
    into a document. So the string ltelementgt can be
    represented in an XML document as ltelementgt.
  • A special form of entity reference, called a
    character reference, can be used to insert
    arbitrary Unicode characters into your document.
    This is a mechanism for inserting characters that
    cannot be typed directly on your keyboard.
  • 3. Comments -- begin with lt!-- and end with --gt.
  • Comments can contain any data except the literal
    string.
  • 4. processing instructions (PIs) -- are an escape
    hatch to provide information to an application.
  • Processing instructions have the form lt?name
    pidata?gt. The name, called the PI target,
    identifies the PI to the application.
  • 5. CDATA Sections to instruct the parser to
    ignore most markup characters.
  • to prevent xml parser from evaluating a CDATA.
  • lt!CDATA p q b (i lt 3) gt 

13
XML Markup 3
  • Between the start of the section, lt!CDATA and
    the end of the section, gt, all character data
    is passed directly to the application, without
    interpretation.
  • The only string that cannot occur in a CDATA
    section is gt.
  • 6. Document Type Declarations
  • XML allows you to create your own tag names.
  • DTD enables document to communicate their
    meta-information to the parser including
  • allowed sequence and nesting of tags,
  • attribute values and their types
  • defaults, the names of external files that may be
    referenced
  • formats of some external (non-XML) data that may
    be referenced,
  • the entities that may be encountered.

14
XML and DTD Syntax
15
DTD Declaration Examples
  • A set of rules
  • define the structure of a document
  • The DTD can be declared internally or externally

lt?xml version"1.0" encoding"UTF-8"?gt lt!DOCTYPE
group SYSTEM "group.dtd"gt ltgroupgt lt/groupgt
lt?xml version "1.0" ?gt lt!DOCTYPE test
lt!ELEMENT name (PCDATA)gt lt!ATTLIST name
rating CDATAgt gt lttestgt lt/testgt
16
DTD Syntax 1
  • lt!ELEMENT name (content_model)gt
  • lt!ATTLIST name gender CDATA gt
  • lt!ENTITY icon SYSTEM icon.jpggt
  • ELEMENT SYNTAX
  • lt!ELEMENT name (content_rule)gt
  • lt!ELEMENT name (a,b,c)gt
  • lt!ELEMENT name (abc)gt
  • lt!ELEMENT name (PCDATA)gt
  • lt!ELEMENT name EMPTYgt
  • lt!ELEMENT name ANYgt
  • lt!ELEMENT name (a,b?,c,d)gt
  • lt!ELEMENT name (abc)gt

17
DTD Syntax 2
  • ATTRIBUTE SYNTAX 1
  • lt!ATTLIST e_name name definitionsgt
  • lt!ATTLIST e_name name CDATA defaultgt
  • lt!ATTLIST e_name name type (abc) defaultgt
  • lt!ATTLIST e_name name ENTITY defaultgt
  • lt!ATTLIST e_name name NMTOKEN defaultgt
  • lt!ATTLIST e_name name ID defaultgt
  • Attribute Defaults
  • REQUIRED -- Value must be supplied
  • IMPLIED -- Value can be left blank
  • FIXED -- Value is fixed
  • Default value supplied.

18
DTD Syntax 3
  • ATTRIBUTE SYNTAX 2
  • lt!ATTLIST car number CDATA REQUIREDgt
  • lt!ATTLIST person gender CDATA IMPLIEDgt
  • lt!ATTLIST person mood CDATA FIXED Happygt
  • lt!ATTLIST car colour (redgreenblue) greengt
  • lt!ATTLIST car colour CDATA greengt
  • ENTITIES
  • Text Substitution
  • lt!ENTITY author Mark
  • author
  • Reference to external entity.
  • lt!ENTITY picture SYSTEM mark.jpggt
  • picture

19
DTD Syntax 4
  • Processing Instructions
  • Specific to an Application
  • lt?xml version 1.0?gt
  • lt?processor specific_instructionvalue?gt

20
DTD Example
lt!ELEMENT RESTAURANTS (RESTAURANT)gt lt!ELEMENT
RESTAURANT (NAME,FOOD_RATING,AMBIANCE_RATING,AVERA
GE_MEAL_COST,REVIEW)gt lt!ATTLIST RESTAURANT
FOOD_GENRE CDATA REQUIREDgt lt!ELEMENT NAME
(PCDATA)gt lt!ELEMENT FOOD_RATING
(PCDATA)gt lt!ELEMENT AMBIANCE_RATING
(PCDATA)gt lt!ELEMENT AVERAGE_MEAL_COST
(PCDATA)gt lt!ELEMENT REVIEW (PCDATA)gt
21
Validation
  • Two categories of XML documents
  • Well-formed Documents
  • it obeys the syntax and the grammar of XML
    documents.
  • A document that includes sequences of markup
    characters that cannot be parsed or are invalid
    cannot be well-formed.
  • not well-formed document -- is not XML document.
  • Checked against XML syntax
  • well-formed and valid
  • well-formed document is valid only if it contains
    a proper document type declaration and if the
    document obeys the constraints of that
    declaration.
  • Checked against DTD

22
XML Document Parsing
Well-formed
XML
XML Document
Further processing of
Well-formed
Valid
XML
PARSER
23
XML Processing and Rendering
  • XML Document/DTD/Parser
  • Document Object Model (DOM)
  • Script/Programming (manipulation of objects)
  • XSL (render ready transformation)
  • Browser/Display Application
  • (rendering)

24
Why XML is so popular?
25
What use is it?
  • Standardised Data Communication.
  • Multiple views of the same data.
  • Client and server-side processing.
  • Improved Searching.
  • Scalability and open standards.
  • Compressibility.
  • For defining other mark-up languages

26
Example Applications 1
  • SpeechML
  • MathML
  • MathML http//www.w3.org/TR/REC-MathML/
  • SMIL
  • Synchronised Multimedia Integration Language
  • SMIL http//www.w3.org/TR/REC-smil/
  • SAML
  • Security Assertion Markup Language
  • WSDL
  • Web Services Description Languages
  • Useful Links includes
  • XML http//www.w3.org/TR/REC-xml/
  • XSL http//www.w3.org/TR/WD-xsl/

27
Example Applications 2
  • XML in Server-Side Technology for thin client
    architecture
  • Applications Integration

28
Combining Java and XML
29
Target System Architecture
30
Next Session
  • Introduction to eXtensible Styling Language
  • Definitions
  • Examples
  • Tutorial session
  • Exercise
About PowerShow.com