Xml by Luqman


Published on

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Xml by Luqman

  1. 1. Mohammed Luqman Shareef
  2. 2. <ul><li>XML </li></ul><ul><li>DTD </li></ul><ul><li>XSD </li></ul><ul><li>XSLT </li></ul><ul><li>Parsers </li></ul>
  3. 3. <ul><li>e X tensible M arkup L anguage </li></ul><ul><li>Derived from SGML ( S tandard G eneralized M arkup L anguage) </li></ul><ul><li>SGML is an international standard for defining the structure of different types electronic documents. </li></ul><ul><li>What is Markup? </li></ul><ul><ul><li>Information added to text to make its structure comprehensible. For ex : Punctuation . </li></ul></ul>
  4. 4. <ul><li>XML is W3C recommendation. </li></ul><ul><li>XML is designed to transport and store data. </li></ul><ul><li>XML tags are not predefined. You must define your own tags. </li></ul><ul><li>XML is designed to be self-descriptive. </li></ul><ul><li>XML Documents Form a Tree Structure </li></ul>
  5. 5. <ul><li>XML shall be straightforwardly usable over the Internet. </li></ul><ul><li>XML shall support a wide variety of applications. </li></ul><ul><li>XML shall be compatible with SGML. </li></ul><ul><li>It shall be easy to write programs which process XML documents. </li></ul><ul><li>The number of optional features in XML is to be kept to the absolute minimum, ideally zero. </li></ul><ul><li>XML documents should be human-legible and reasonably clear. </li></ul><ul><li>The XML design should be prepared quickly. </li></ul><ul><li>The design of XML shall be formal and concise. </li></ul><ul><li>XML documents shall be easy to create. </li></ul>
  6. 6. <ul><li>XML is case sensitive </li></ul><ul><li>All start tags must have end tags </li></ul><ul><li>Elements must be properly nested </li></ul><ul><li>XML declaration is the first statement </li></ul><ul><li>Every document must contain a root element </li></ul><ul><li>Attribute values must have quotation marks </li></ul><ul><li>Certain characters are reserved for parsing </li></ul>
  7. 7. <ul><li>Elements </li></ul><ul><li>Attributes </li></ul><ul><li>Entity References </li></ul><ul><li>Comments </li></ul><ul><li>Document Type Declarations </li></ul>
  8. 8. <ul><li>A Document Type Definition ( DTD ) allows the developer to create a set of rules to specify legal content and place restrictions on an XML file </li></ul><ul><li>If the XML document does not follow the rules contained within the DTD, a parser generates an error </li></ul><ul><li>An XML document that conforms to the rules within a DTD is said to be valid </li></ul><ul><li>A single DTD ensures a common format for each XML document that references it </li></ul><ul><li>An application can use a standard DTD to verify that data that it receives from the outside world is valid </li></ul>
  9. 9. <ul><li>An element type has element content when elements of that type must contain only child elements (no character data), optionally separated by white space. </li></ul><ul><li>If an element name in DTD is followed by the star [*], this element can occur zero, once or several times. </li></ul><ul><li>If an element name in DTD is followed by the plus [+], this element can occur once or several times. </li></ul><ul><li>If an element name in DTD is followed by the question mark [?], this element can occur zero or one times. </li></ul><ul><li>With character [ | ] you can select one from several elements. </li></ul>
  10. 10. <ul><li>Attributes are used to associate name-value pairs with elements. Attribute specifications may appear only within start-tags and empty-element tags. The declaration starts with ATTLIST then follows the name of the element the attributes belong to and then follows the definition of the individual attributes. </li></ul><ul><li>An attribute of CDATA type can contain any character if it conforms to well formedness constraints. </li></ul><ul><li>An element can be defined EMPTY. In such a case it can contain only attributes but no text. </li></ul>
  11. 11. <ul><li>defines elements that can appear in a document </li></ul><ul><li>defines attributes that can appear in a document </li></ul><ul><li>defines which elements are child elements </li></ul><ul><li>defines the order of child elements </li></ul><ul><li>defines the number of child elements </li></ul><ul><li>defines whether an element is empty or can include text </li></ul><ul><li>defines data types for elements and attributes </li></ul><ul><li>defines default and fixed values for elements and attributes </li></ul>
  12. 12. <ul><li>XML Schemas are extensible to future additions </li></ul><ul><li>XML Schemas are richer and more powerful than DTDs </li></ul><ul><li>XML Schemas are written in XML </li></ul><ul><li>XML Schemas support data types </li></ul><ul><li>XML Schemas support namespaces </li></ul>
  13. 13. <ul><li>XSL (Extensible Stylesheet Language) </li></ul><ul><li>XSLT transforms an XML document into another XML document. </li></ul><ul><li>All Major browsers support XSLT. </li></ul><?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?> <xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;> <xsl:template match=&quot;/&quot;>   <html>   <body>   <h2>My CD Collection</h2>   <table border=&quot;1&quot;>     <tr bgcolor=&quot;#9acd32&quot;>       <th>Title</th>       <th>Artist</th>     </tr>     <xsl:for-each select=&quot;catalog/cd&quot;>     <tr>       <td><xsl:value-of select=&quot;title&quot;/></td>       <td><xsl:value-of select=&quot;artist&quot;/></td>     </tr>     </xsl:for-each>   </table>   </body>   </html> </xsl:template> </xsl:stylesheet>
  14. 14. <ul><li>The design goals of XML include &quot;It shall be easy to write programs which process XML documents </li></ul><ul><li>Types of parsing APIs </li></ul><ul><ul><li>Stream-oriented - for example SAX and StAX. </li></ul></ul><ul><ul><li>Tree-traversal - for example DOM. </li></ul></ul><ul><ul><li>XML data binding - Mapping XML elements to programming languages </li></ul></ul><ul><ul><li>Declarative transformation - XSLT and XQuery. </li></ul></ul>