eXtensible Markup Language


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

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

No notes for slide

eXtensible Markup Language

  1. 1. e X tensible M arkup L anguage P repared b y A ditya R aj e X tensible S tylesheet L anguage
  2. 2. By end of this presentation, we will be able to know What is XML? Why to choose XML? What is XML schema? XML structure Basics of XML coding
  3. 3. What is XML? XML is a general purpose, cross platform, markup language, that is supported by W3C (World Wide Consortium) and is used for communication between systems on different or same platform. XML is used to describe and store data and should not be misunderstood with a programming language. The good news is XML tags are not predefined and you can define your own tags 
  4. 4. Why to choose XML? XML stores the data in a structured manner Data can just not be stored but also it can be described to any extent Systems using XML are considered to be highly scalable Structural changes to data can be managed easily Easy to learn and easy to use In machine and human readable format XML is FREE
  5. 5. What is a XML schema? XML Schema are guidelines or format for describing data using XML. In order to use XML data it must conform to these standards. The oldest schema format for XML is DTD (Document Type Definition) but it is now obsolete as:  It has no support for new features  Certain aspects of data cannot be described using DTD XSD (XML Schema Definition) is one of the most powerful XML schemas and is commonly used. They allow detailed constraints on an XML document’s logical structure. Finally it depends on the system requirement and data type that which XML schema should be used.
  6. 6. XML structure Data Structure of XML can best described as a hierarchy of information like a tree. A hierarchy structure has a parent, child and a sibling relationship with other entities. In XML every entity at any level can have its own properties. Siblings Parent Child Name Age Gender Properties
  7. 7. Basic XML coding <addressBook> <contact fName=&quot;john&quot; lName=&quot;“ nickName=&quot;Johny&quot; dob=&quot;1st January 1990&quot;> </contact> <email>john@yahoo.com</email> <numbers> </numbers> <address> </address> <streetAddress>123, x block, Vasant Vihar </streetAddress> <country>India</country> <state>New Delhi</state> <zipCode>110057</zipCode> <mobile>9988998899</mobile> <mobile>9988998800</mobile> <homeNumber>01126150000</homeNumber> <?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?> </addressBook> Address Book Contact Email Numbers Address Mobile Home Phone State Country Street Address Contact Email Numbers Address Mobile Home Phone State Country Street Address
  8. 8. Now we are about to know: What is XSL? What is XSLT? What is XPath? Example
  9. 9. What is XSL? <ul><li>XSL is developed by W3C to facilitate need of style sheet to display formatted information stored in XML like CSS is there for HTML. </li></ul><ul><li>XSL is like a tripod supported by three legs called: </li></ul><ul><li>XSLT (eXtensible Stylesheet Language Transformation) </li></ul><ul><li>XPath (XML Path Language) </li></ul><ul><li>XSL-FO (eXtensible Stylesheet Language Formatting Objects) </li></ul><ul><li>XSL is classified under two operations, formatting and transformation. XSLT describes the transformation of XSL and XSL-FO is used for formatting but practically they are same . </li></ul>
  10. 10. What is XSLT? XSLT (eXtensible Stylesheet Language Transformation) transforms XML data using XSL to form a well formatted document, usually HTML. About XSLT processors One of the most simplest way of XSLT is client side, so when a XML document is requested by client application, it refers to its related XSL file and the transformation takes place at the client side. This method is not recommended due to compatibility concerns as it is highly possible that client might not support XML transformation or may not support the latest features. Hence it is recommended to perform the transformation at the server level and pass the resulted data to the client, avoiding any compatibility concerns. There are several standalone software and libraries available for performing transformation. Like for ruby on rails we have library named XSLT and for Windows XP we have MSXML 3.
  11. 11. What is XPath? XPath (XML Path Language) is used to navigate the data inside XML document to find required information and it is also used for computing values, in simple words XPath is a small query language . XPath expressions Selects first child element of the node nodename/node[1] Selects all nodes in the document //* Selects all child nodes of the node nodename/* Selects attributes @ Selects the parent of the current node .. Selects the current node . Selects nodes in the document from the current node that match the selection no matter where they are // Selects from the root node / Selects all child nodes of the node nodename Description Expression
  12. 12. Now lets make XSL for the XML we made before !! Line 2 tells the XML document that which XSL should be used for transformation. FINALLY !!
  13. 13. Thanks…