Wednesday 10 December 2014

X M L

xml 

Extensible Markup Languange


-   designated to describe data & focus what data is
-   created to structure,store & transport information
-   data will be available to all kind of reading machine
-   not a replacement but a complement for HTML
-   most common tool for data transmission between all sort of application


USAGE OF XML

  • separates data from HTML
    *it will be easier if we concentrate using  HTML just for the layout & display, while for data we can store separately in XML files
  • simplifies data sharing
    *data can be easily exchangeld between incompatible system, thus xml is known as one of most time-consuming and is greatly reduces the complexity since it can be read by different incompatible application
  • simplifies platform changes
    *since data is  stored in text format, so it easier to upgrade it to new OS, new apps or new browser without losing data
  • makes data more available
    *data can be available in all kinds of reading machines
  • to create new Internet languange
    *exp ; XHTML is latest version of HTML
             ; RSS languange for news feeds

 
XML TREE
(not really like that! hehe)

 
THE REAL XML TREE















  











XML SYNTAX RULE

  • all elementmust have closing tag
  • tag are cASe SEnsiTiVe
    *exp : <incorrect>This is incorrect</Incorrect>
               <correct>This is correct</correct>
  • must be properly nested
  • must have root element(parent)
  • attribute must be quoted
    *exp : <note date=12/11/2007>
              
    <note date="12/11/2007">
  • comment must be in this format (<!comment>)
  • white space is preserved

XML ELEMENTS

-Everything from elements start tag to elements end tag
-it may have attribute
-exp : 

<bookstore>
  <book category="CHILDREN">
    <title>Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
  </book>
  <book category="WEB">
    <title>Learning XML</title>
    <author>Erik T. Ray</author>
    <year>2003</year>
    <price>39.95</price>
  </book>
</bookstore>


NAMING RULES!

  1. CANNOT contain letters, numbers, other characters
  2. CANNOT start with letters XML,xml,Xml,xML etc
  3. CANNOT contain space 
 you might want further explaination about this, you may refer this :)

lastly, let us compare between XML and HTML

 

Difference between HTML and XML

XML HTML
transport and store data display data
focus on what data is focus on how it look
carry information display information

No comments:

Post a Comment