Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

What is xml


Published on

XMl ppt

Published in: Education
  • Be the first to comment

  • Be the first to like this

What is xml

  1. 1. XML PRESENTATIONExtensionmarkuplanguage<br />BY:<br />Sachit Singh<br /><br />
  2. 2. Content of presentation<br /><ul><li>Introduction
  3. 3. Comparison between XML AND HTML
  4. 4. XML SYNTAX
  6. 6. Limitation of HTML
  7. 7. Challenges
  8. 8. Summery
  9. 9.</li></li></ul><li>WHAT IS XML<br /><ul><li> XML- Extension markup language
  10. 10. Markup language for document containing structured information
  11. 11. XML is define by four specification-
  12. 12. XML- Extension markup language
  13. 13. XLL- Extension link language
  14. 14. XSL- Extension Style or layout language
  15. 15. XUA- Extension USER agent </li></ul><br />
  16. 16. XML…..<br /><ul><li>XML is based on standard generalize markup language (SGML)
  17. 17. XML Version 1.0 introduced by world wide web consortium (W3C) in 1998
  18. 18. Bridge for data exchange on the web </li></ul><br />
  19. 19. <ul><li>XML </li></ul>Extensible set of tags<br />Content oriented<br />Standard data infrastructure<br />Allows multiple output forms<br /><ul><li>HTML</li></ul>Fixed set of tags<br />Presentation oriented<br />No data validation capability<br />Single presentation<br />Comparison <br /><br />
  20. 20. Authoring XML Elements<br /><ul><li>An XML element is made up of a start tag, an end tag, and data in between.</li></ul>Example:<br /> <director> Prabhu Deva </director><br />Example of another element with the same value:<br /> <actor> Salman Khan </actor><br /><ul><li>XML tags are case-sensitive:</li></ul> <CITY> <City> <city><br /><ul><li>XML can abbreviate empty elements</li></ul>for example:<br /> <married> </married> can be abbreviated to<br /> <married/><br /><br />
  21. 21. Authoring XML Elements (cont’d)<br /><ul><li>An attribute is a name-value pair separated by an equal sign (=).</li></ul>Example:<br /> <City ZIP=“400097”> Malad</City><br /><ul><li>Attributes are used to attach additional, secondary information to an element.</li></ul><br />
  22. 22. Authoring XML Documents<br /><ul><li>A basic XML document is an XML element that can, but might not, include nested XML elements.</li></ul>Example:<br /> <books><br /> <book isbn=“123”><br /> <title> C++ </title><br /> <author> Bal Guru Swami </author><br /> </book><br /> </books><br /><br />
  23. 23. Authoring XML Documents (cont’d)<br /><ul><li>Authoring guidelines:</li></ul>All elements must have an end tag.<br />All elements must be cleanly nested (overlapping elements are not allowed).<br />All attribute values must be enclosed in quotation marks.<br />Each document must have a unique first element, the root node.<br /><br />
  24. 24. Authoring XML Data Islands<br /><ul><li>A data island is an XML document that exists within an HTML page.
  25. 25. 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.</li></ul><br />
  26. 26. Authoring XML Data Islands (cont’d)<br /><ul><li>Example:</li></ul> <XML ID=“XMLID”><br /> <customer><br /> <name> Mithlesh Singh</name><br /> <custID> 12345 </custID><br /> </customer><br /> </XML><br /><br />
  27. 27. Document Type Definitions (DTD)<br /><ul><li>An XML document may have an optional DTD.
  28. 28. DTD serves as grammar for the underlying XML document, and it is part of XML language.
  29. 29. DTDs are somewhat unsatisfactory, but no consensus exists so far beyond the basic DTDs.
  30. 30. DTD has the form:</li></ul> <!DOCTYPE name [markupdeclaration]><br /><br />
  31. 31. DTD (cont’d)<br />Consider an XML document:<br /> <db><person><name>Mithlesh Singh</name><br /> <age>18</age><br /> <email> </email><br /> </person><br /> <person>………</person><br /> ……….<br /> </db><br /><br />
  32. 32. DTD (cont’d)<br /><ul><li>DTD for it might be:</li></ul> <!DOCTYPE db [<br /> <!ELEMENT db (person*)><br /> <!ELEMENT person (name, age, email)><br /> <!ELEMENT name (#PCDATA)><br /> <!ELEMENT age (#PCDATA)><br /> <!ELEMENT email (#PCDATA)><br /> ]><br />
  33. 33. DTD (cont’d)<br />Occurrence Indicator:<br />
  34. 34. XML Query Languages<br /><ul><li>The first XML query languages</li></ul>LOREL (Stanford)<br />XQL<br /><ul><li>Several other query languages have been developed (e.g. UNQL, XPath)</li></ul>XML-QL considered by W3C for standardization<br />Currently W3C is considering and working on a new query language: XQuery<br /><br />
  35. 35. A Query Language for XML: XML-QL<br /><ul><li>Developed at AT&T labs
  36. 36. To extract data from the input XML data
  37. 37. Has variables to which data is bound and templates which show how the output XML data is to be constructed
  38. 38. Uses the XML syntax
  39. 39. Based on a where/construct syntax</li></ul>Where combines from and where parts of SQL<br />Construct corresponds to SQL’s select <br />
  40. 40. XML-QL Query: Example 1<br /><ul><li>Retrieve all authors of books published by Bal guru swami:</li></ul> where <book><br /> <publisher><name><br /> Bal Guru Swami <br /> </name> </publisher><br /> <title> $T </title><br /> <author> $A </author><br /> </book> in “www.a.b.c/abc.xml”<br /> construct <result> $A </result><br />
  41. 41. XML-QL Query: Example 2<br /><ul><li>XML-QL query asking for all bookstores that sell The C++ Programming Language for under $25:</li></ul>where <store><br /> <name> $N </name><br /> <book><br /> <title> The C++ Programming Language </title><br /> <price> $P </price><br /> </book><br /> </store> in “”<br /> $P < 25<br />construct <result> $N </result><br />
  42. 42. Semi structured Data and Mediators<br /><ul><li>Semi structured data is often encountered in data exchange and integration
  43. 43. At the sources the data may be structured (e.g. from relational databases)
  44. 44. We model the data as semi structured to facilitate exchange and integration
  45. 45. Users see an integrated semi structured view that they can query
  46. 46. Queries are eventually reformulated into queries over the structured resources (e.g. SQL)
  47. 47. Only results need to be materialized</li></li></ul><li>What is a mediator ?<br /><ul><li>A complex software component that integrates and transforms data from one or several sources using a declarative specification
  48. 48. Two main contexts:</li></ul>Data conversion: converts data between two different models<br />e.g. by translating data from a relational database into XML<br />Data integration: integrates data from different sources into a common view<br />
  49. 49. price<br />stock<br />StoreBook<br />Store<br />Book<br />authors<br />name<br />bid<br />phone<br />title<br />sid<br />Converting Relational Database to XML<br />Example: Export the following data into XML and group books by store<br />Relational Database:<br /> Store (sid, name, phone)<br /> Book (bid, title, authors)<br />StoreBook (sid, bid, price, stock)<br />
  50. 50. Converting Relational Database to XML (Cont’d)<br /><ul><li>XML:</li></ul> <store> <name> … </name><br /> <phone> … </phone><br /> <book> <title>… </title> <br /> <authors> … </authors><br /> <price> … </price><br /> </book><br /> <book>…</book> <br /> …<br /> </store><br />
  51. 51. Limitation of HTML<br /><ul><li>Limitations of HTML</li></ul> – Structure of data expressed as layout<br /> – Semantics of data hard to analyze and difficult to share<br /> – No schemas, no constraints<br /><ul><li> Thus XML (extensible Markup Language) has been developed</li></ul> – Markup language to define structured documents<br /> – Document schemas to fix the structure of documents<br /> – User-defined markup to express semantics<br /> – XML architecture for processing and extended functionality<br />
  52. 52. Summery<br /><ul><li>What is XML?
  53. 53. Comparisons of XML AND HTML
  54. 54. Authoring XML Elements
  55. 55. Authoring XML Elements (cont’d)
  56. 56. Authoring XML Documents
  57. 57. Authoring XML Documents (cont’d)
  58. 58. And many more……</li></li></ul><li>THANK YOU<br />THANKS FOR HEARING ME <br /><br />