SlideShare a Scribd company logo
1 of 25
eXtensible   Markup Language (XML)


                       By:
                       Albert Beng Kiat Tan
                       Ayzer Mungan
                       Edwin Hendriadi
Outline of Presentation
 Introduction
 Comparison between XML and HTML
 XML Syntax
 XML Queries and Mediators
 Challenges
 Summary
What is XML?
 eXtensible Markup Language
 Markup language for documents containing
  structured information
 Defined by four specifications:
       XML, the Extensible Markup Language
       XLL, the Extensible Linking Language
       XSL, the Extensible Style Language
       XUA, the XML User Agent
XML….
 Based on Standard Generalized Markup
  Language (SGML)
 Version 1.0 introduced by World Wide Web
  Consortium (W3C) in 1998
 Bridge for data exchange on

  the Web
Comparisons
     XML                        HTML
 Extensible set of tags    Fixed set of tags
 Content orientated        Presentation oriented
 Standard Data             No data validation
  infrastructure             capabilities
 Allows multiple           Single presentation
  output forms
Authoring XML
    Elements
   An XML element is made up of a start tag, an end
    tag, and data in between.
   Example:
       <director> Matthew Dunn </director>
   Example of another element with the same value:
       <actor> Matthew Dunn </actor>
   XML tags are case-sensitive:
       <CITY> <City> <city>
   XML can abbreviate empty elements, for example:
    <married> </married> can be abbreviated to
    <married/>
Authoring XML
Elements (cont’d)
 An attribute is a name-value pair separated
  by an equal sign (=).
 Example:

   <City ZIP=“94608”> Emeryville </City>
 Attributes are used to attach additional,
  secondary information to an element.
Authoring XML
    Documents
 A basic XML document is an XML element
  that can, but might not, include nested XML
  elements.
 Example:
    <books>
       <book isbn=“123”>
           <title> Second Chance </title>
           <author> Matthew Dunn </author>
       </book>
    </books>
XML Data Model:
  Example
<BOOKS>
<book id=“123”                                   BOOKS
  loc=“library”>                           book
                            loc=“library”              article
  <author>Hull</author>
  <title>California</title>                    ref
                                  123                    555
  <year> 1995 </year>
</book>                        author     year     author        title
<article id=“555”                  title
  ref=“123”>
  <author>Su</author>        Hull          1995 Su             Purdue
  <title> Purdue</title>           California
</article>
</BOOKS>
Authoring XML
Documents (cont’d)
 Authoring   guidelines:
   All elements must have an end tag.
   All elements must be cleanly nested
    (overlapping elements are not allowed).
   All attribute values must be enclosed in
    quotation marks.
   Each document must have a unique first
    element, the root node.
Authoring XML Data
Islands
   A data island is an XML document that exists
    within an HTML page.

   The <XML> element marks the beginning of
    the data island, and its ID attribute provides a
    name that you can use to reference the data
    island.
Authoring XML Data
Islands (cont’d)
   Example:
    <XML ID=“XMLID”>
       <customer>
            <name> Mark Hanson </name>
            <custID> 29085 </custID>
       </customer>
    </XML>
Document Type
    Definitions (DTD)
 An XML document may have an optional
  DTD.
 DTD serves as grammar for the underlying
  XML document, and it is part of XML
  language.
 DTDs are somewhat unsatisfactory, but no
  consensus exists so far beyond the basic
  DTDs.
 DTD has the form:
    <!DOCTYPE name [markupdeclaration]>
DTD (cont’d)
Consider an XML document:
<db><person><name>Alan</name>
             <age>42</age>
             <email>agb@usa.net </email>
     </person>
     <person>………</person>
     ……….
</db>
DTD (cont’d)

   DTD for it might be:
    <!DOCTYPE db [
      <!ELEMENT db (person*)>
      <!ELEMENT person (name, age, email)>
      <!ELEMENT name (#PCDATA)>
      <!ELEMENT age (#PCDATA)>
      <!ELEMENT email (#PCDATA)>
    ]>
DTD (cont’d)
Occurrence Indicator:
Indicator                   Occurrence

(no indicator)   Required        One and only
                                 one
?                Optional        None or one

*                Optional,       None, one, or
                 repeatable      more
+                Required,       One or more
                 repeatable
XML Query Languages
   The first XML query languages
       LOREL (Stanford)
       XQL
 Several other query languages have been
  developed (e.g. UNQL, XPath)
 XML-QL considered by W3C for
  standardization
 Currently W3C is considering and working on
  a new query language: XQuery
A Query Language for
    XML: XML-QL
 Developed at AT&T labs
 To extract data from the input XML data
 Has variables to which data is bound and
  templates which show how the output XML
  data is to be constructed
 Uses the XML syntax
 Based on a where/construct syntax
    Where combines from and where parts of
     SQL
    Construct corresponds to SQL’s select
XML-QL Query: Example 1
   Retrieve all authors of books published by
    Morgan Kaufmann:

    where <book>
              <publisher><name>
               Morgan Kaufmann
              </name> </publisher>
             <title> $T </title>
             <author> $A </author>
        </book> in “www.a.b.c/bib.xml”
    construct <result> $A </result>
XML-QL Query: Example 2
   XML-QL query asking for all bookstores that sell
    The Java Programming Language for under $25:
where <store>
          <name> $N </name>
          <book>
          <title> The Java Programming Language </title>
          <price> $P </price>
          </book>
       </store> in “www.store/bib.xml”
       $P < 25
construct <result> $N </result>
Semistructured Data and
Mediators
   Semistructured data is often encountered in data
    exchange and integration
   At the sources the data may be structured (e.g. from
    relational databases)
   We model the data as semistructured to facilitate
    exchange and integration
   Users see an integrated semistructured view that
    they can query
   Queries are eventually reformulated into queries over
    the structured resources (e.g. SQL)
   Only results need to be materialized
What is a mediator ?
   A complex software component that
    integrates and transforms data from one or
    several sources using a declarative
    specification
   Two main contexts:
     Data conversion: converts data between
      two different models
          e.g. by translating data from a relational
           database into XML
     Data  integration: integrates data from
      different sources into a common view
Converting Relational
Database to XML
Example: Export the following data into XML and group
  books by store
 Relational Database:

  Store (sid, name, phone)
  Book (bid, title, authors)
  StoreBook (sid , bid, price, stock)

                      price     stock

 name       Store        StoreBook         Book     authors


    phone       sid                     title     bid
Converting Relational
    Database to XML (Cont’d)
   XML:
    <store> <name> … </name>
           <phone> … </phone>
           <book> <title>… </title>
                  <authors> … </authors>
                  <price> … </price>
           </book>
           <book>…</book>
           …
    </store>
Challenges facing XML
   Integration of data sharing



   Security

More Related Content

What's hot

01 xml document structure
01 xml document structure01 xml document structure
01 xml document structureBaskarkncet
 
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xmlXml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xmlÔng Thông
 
XML Document Object Model (DOM)
XML Document Object Model (DOM)XML Document Object Model (DOM)
XML Document Object Model (DOM)BOSS Webtech
 
Xml basics
Xml basicsXml basics
Xml basicsKumar
 
Unit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascriptUnit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascriptzahid7578
 

What's hot (20)

01 xml document structure
01 xml document structure01 xml document structure
01 xml document structure
 
XML
XMLXML
XML
 
Markup Languages
Markup Languages Markup Languages
Markup Languages
 
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xmlXml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xml
 
Web page concept final ppt
Web page concept  final pptWeb page concept  final ppt
Web page concept final ppt
 
XML Document Object Model (DOM)
XML Document Object Model (DOM)XML Document Object Model (DOM)
XML Document Object Model (DOM)
 
Xml
XmlXml
Xml
 
Xml Lecture Notes
Xml Lecture NotesXml Lecture Notes
Xml Lecture Notes
 
03 x files
03 x files03 x files
03 x files
 
Xml basics
Xml basicsXml basics
Xml basics
 
Unit iv xml
Unit iv xmlUnit iv xml
Unit iv xml
 
Xml 215-presentation
Xml 215-presentationXml 215-presentation
Xml 215-presentation
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
fundamentals of XML
fundamentals of XMLfundamentals of XML
fundamentals of XML
 
Xml p2 Lecture Notes
Xml p2 Lecture NotesXml p2 Lecture Notes
Xml p2 Lecture Notes
 
XML Databases
XML DatabasesXML Databases
XML Databases
 
Xml basics for beginning
Xml basics for beginningXml basics for beginning
Xml basics for beginning
 
Basics of XML
Basics of XMLBasics of XML
Basics of XML
 
Unit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascriptUnit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascript
 
Xml dom
Xml domXml dom
Xml dom
 

Viewers also liked

Taking Your Practice Into the Cloud (2011)
Taking Your Practice Into the Cloud (2011)Taking Your Practice Into the Cloud (2011)
Taking Your Practice Into the Cloud (2011)Antigone Peyton
 
The Near Future of CSS
The Near Future of CSSThe Near Future of CSS
The Near Future of CSSRachel Andrew
 
Classroom Management Tips for Kids and Adolescents
Classroom Management Tips for Kids and AdolescentsClassroom Management Tips for Kids and Adolescents
Classroom Management Tips for Kids and AdolescentsShelly Sanchez Terrell
 
How to Battle Bad Reviews
How to Battle Bad ReviewsHow to Battle Bad Reviews
How to Battle Bad ReviewsGlassdoor
 
The Presentation Come-Back Kid
The Presentation Come-Back KidThe Presentation Come-Back Kid
The Presentation Come-Back KidEthos3
 
The Buyer's Journey - by Chris Lema
The Buyer's Journey - by Chris LemaThe Buyer's Journey - by Chris Lema
The Buyer's Journey - by Chris LemaChris Lema
 

Viewers also liked (6)

Taking Your Practice Into the Cloud (2011)
Taking Your Practice Into the Cloud (2011)Taking Your Practice Into the Cloud (2011)
Taking Your Practice Into the Cloud (2011)
 
The Near Future of CSS
The Near Future of CSSThe Near Future of CSS
The Near Future of CSS
 
Classroom Management Tips for Kids and Adolescents
Classroom Management Tips for Kids and AdolescentsClassroom Management Tips for Kids and Adolescents
Classroom Management Tips for Kids and Adolescents
 
How to Battle Bad Reviews
How to Battle Bad ReviewsHow to Battle Bad Reviews
How to Battle Bad Reviews
 
The Presentation Come-Back Kid
The Presentation Come-Back KidThe Presentation Come-Back Kid
The Presentation Come-Back Kid
 
The Buyer's Journey - by Chris Lema
The Buyer's Journey - by Chris LemaThe Buyer's Journey - by Chris Lema
The Buyer's Journey - by Chris Lema
 

Similar to Xml 215-presentation (20)

Web page concept Basic
Web page concept  BasicWeb page concept  Basic
Web page concept Basic
 
Unit 10: XML and Beyond (Sematic Web, Web Services, ...)
Unit 10: XML and Beyond (Sematic Web, Web Services, ...)Unit 10: XML and Beyond (Sematic Web, Web Services, ...)
Unit 10: XML and Beyond (Sematic Web, Web Services, ...)
 
Web services Overview in depth
Web services Overview in depthWeb services Overview in depth
Web services Overview in depth
 
XML
XMLXML
XML
 
Xml
Xml Xml
Xml
 
[DSBW Spring 2010] Unit 10: XML and Web And beyond
[DSBW Spring 2010] Unit 10: XML and Web And beyond[DSBW Spring 2010] Unit 10: XML and Web And beyond
[DSBW Spring 2010] Unit 10: XML and Web And beyond
 
Understanding XML DOM
Understanding XML DOMUnderstanding XML DOM
Understanding XML DOM
 
1 xml fundamentals
1 xml fundamentals1 xml fundamentals
1 xml fundamentals
 
Xml and DTD's
Xml and DTD'sXml and DTD's
Xml and DTD's
 
Chapter4
Chapter4Chapter4
Chapter4
 
Introduction to xml schema
Introduction to xml schemaIntroduction to xml schema
Introduction to xml schema
 
Xml transformation language
Xml transformation languageXml transformation language
Xml transformation language
 
CTDA Workshop on XML and MODS
CTDA Workshop on XML and MODSCTDA Workshop on XML and MODS
CTDA Workshop on XML and MODS
 
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web TechnologyInternet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
 
Xslt
XsltXslt
Xslt
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)
 
Web Information Systems XML
Web Information Systems XMLWeb Information Systems XML
Web Information Systems XML
 
XML Schema.pptx
XML Schema.pptxXML Schema.pptx
XML Schema.pptx
 
Introduction to XSLT
Introduction to XSLTIntroduction to XSLT
Introduction to XSLT
 
XML1.pptx
XML1.pptxXML1.pptx
XML1.pptx
 

Recently uploaded

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 

Recently uploaded (20)

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 

Xml 215-presentation

  • 1. eXtensible Markup Language (XML) By: Albert Beng Kiat Tan Ayzer Mungan Edwin Hendriadi
  • 2. Outline of Presentation  Introduction  Comparison between XML and HTML  XML Syntax  XML Queries and Mediators  Challenges  Summary
  • 3. What is XML?  eXtensible Markup Language  Markup language for documents containing structured information  Defined by four specifications:  XML, the Extensible Markup Language  XLL, the Extensible Linking Language  XSL, the Extensible Style Language  XUA, the XML User Agent
  • 4. XML….  Based on Standard Generalized Markup Language (SGML)  Version 1.0 introduced by World Wide Web Consortium (W3C) in 1998  Bridge for data exchange on the Web
  • 5. Comparisons XML HTML  Extensible set of tags  Fixed set of tags  Content orientated  Presentation oriented  Standard Data  No data validation infrastructure capabilities  Allows multiple  Single presentation output forms
  • 6. Authoring XML Elements  An XML element is made up of a start tag, an end tag, and data in between.  Example: <director> Matthew Dunn </director>  Example of another element with the same value: <actor> Matthew Dunn </actor>  XML tags are case-sensitive: <CITY> <City> <city>  XML can abbreviate empty elements, for example: <married> </married> can be abbreviated to <married/>
  • 7. Authoring XML Elements (cont’d)  An attribute is a name-value pair separated by an equal sign (=).  Example: <City ZIP=“94608”> Emeryville </City>  Attributes are used to attach additional, secondary information to an element.
  • 8. Authoring XML Documents  A basic XML document is an XML element that can, but might not, include nested XML elements.  Example: <books> <book isbn=“123”> <title> Second Chance </title> <author> Matthew Dunn </author> </book> </books>
  • 9. XML Data Model: Example <BOOKS> <book id=“123” BOOKS loc=“library”> book loc=“library” article <author>Hull</author> <title>California</title> ref 123 555 <year> 1995 </year> </book> author year author title <article id=“555” title ref=“123”> <author>Su</author> Hull 1995 Su Purdue <title> Purdue</title> California </article> </BOOKS>
  • 10. Authoring XML Documents (cont’d)  Authoring guidelines:  All elements must have an end tag.  All elements must be cleanly nested (overlapping elements are not allowed).  All attribute values must be enclosed in quotation marks.  Each document must have a unique first element, the root node.
  • 11. Authoring XML Data Islands  A data island is an XML document that exists within an HTML page.  The <XML> element marks the beginning of the data island, and its ID attribute provides a name that you can use to reference the data island.
  • 12. Authoring XML Data Islands (cont’d)  Example: <XML ID=“XMLID”> <customer> <name> Mark Hanson </name> <custID> 29085 </custID> </customer> </XML>
  • 13. Document Type Definitions (DTD)  An XML document may have an optional DTD.  DTD serves as grammar for the underlying XML document, and it is part of XML language.  DTDs are somewhat unsatisfactory, but no consensus exists so far beyond the basic DTDs.  DTD has the form: <!DOCTYPE name [markupdeclaration]>
  • 14. DTD (cont’d) Consider an XML document: <db><person><name>Alan</name> <age>42</age> <email>agb@usa.net </email> </person> <person>………</person> ………. </db>
  • 15. DTD (cont’d)  DTD for it might be: <!DOCTYPE db [ <!ELEMENT db (person*)> <!ELEMENT person (name, age, email)> <!ELEMENT name (#PCDATA)> <!ELEMENT age (#PCDATA)> <!ELEMENT email (#PCDATA)> ]>
  • 16. DTD (cont’d) Occurrence Indicator: Indicator Occurrence (no indicator) Required One and only one ? Optional None or one * Optional, None, one, or repeatable more + Required, One or more repeatable
  • 17. XML Query Languages  The first XML query languages  LOREL (Stanford)  XQL  Several other query languages have been developed (e.g. UNQL, XPath)  XML-QL considered by W3C for standardization  Currently W3C is considering and working on a new query language: XQuery
  • 18. A Query Language for XML: XML-QL  Developed at AT&T labs  To extract data from the input XML data  Has variables to which data is bound and templates which show how the output XML data is to be constructed  Uses the XML syntax  Based on a where/construct syntax  Where combines from and where parts of SQL  Construct corresponds to SQL’s select
  • 19. XML-QL Query: Example 1  Retrieve all authors of books published by Morgan Kaufmann: where <book> <publisher><name> Morgan Kaufmann </name> </publisher> <title> $T </title> <author> $A </author> </book> in “www.a.b.c/bib.xml” construct <result> $A </result>
  • 20. XML-QL Query: Example 2  XML-QL query asking for all bookstores that sell The Java Programming Language for under $25: where <store> <name> $N </name> <book> <title> The Java Programming Language </title> <price> $P </price> </book> </store> in “www.store/bib.xml” $P < 25 construct <result> $N </result>
  • 21. Semistructured Data and Mediators  Semistructured data is often encountered in data exchange and integration  At the sources the data may be structured (e.g. from relational databases)  We model the data as semistructured to facilitate exchange and integration  Users see an integrated semistructured view that they can query  Queries are eventually reformulated into queries over the structured resources (e.g. SQL)  Only results need to be materialized
  • 22. What is a mediator ?  A complex software component that integrates and transforms data from one or several sources using a declarative specification  Two main contexts:  Data conversion: converts data between two different models  e.g. by translating data from a relational database into XML  Data integration: integrates data from different sources into a common view
  • 23. Converting Relational Database to XML Example: Export the following data into XML and group books by store  Relational Database: Store (sid, name, phone) Book (bid, title, authors) StoreBook (sid , bid, price, stock) price stock name Store StoreBook Book authors phone sid title bid
  • 24. Converting Relational Database to XML (Cont’d)  XML: <store> <name> … </name> <phone> … </phone> <book> <title>… </title> <authors> … </authors> <price> … </price> </book> <book>…</book> … </store>
  • 25. Challenges facing XML  Integration of data sharing  Security