Friday, 1 November 2013

A Peak into XML


Assalam 'Alaik..
Peace upon to all of you..

Now, it's time for you to learn something new, (because we have learnt it, and we wanted you to know :) ).

XML represents the Extensible Markup Language as the markup language that define the rules that encoding document, which is both human readable and machine-readable.

While HTML is designed to display data which mainly focus on how the data would look, the XML is designed to be the software, or the independent tool to transport and store data, which basically focus on what data is.

The table below simplifies the differences between the HTML and the XML.


         Case sensitive   

    Case insensitive    
       Custom tags can        
             be defined  
         Has it own      
      predefined tags 

          Transport data 
  between the application  
        and the database  

     Use for designing   
         a web-page

<note> is the root element, while (to, from, heading, and body) is the elements of the root element.
And the last line of </note> indicates that this is indeed a note from Nick to Jonas.

From the note above, it is quite descriptive note, as the tags written can be "invented" by anyone, even you yourself. It's up to you what would like to write down to structure your own document. XML is used to carry information, after all. :)

Thus, all elements can have text content and attributes.

Which basically means that the figure above comprises everything in one book, and that the XML shows the details behind it, with "book store" becomes the root element, and "book" has 4 children of "title", "author", "year", and "price".

Another point to noted, is that in each attribute, the value must be quoted for the XML document does not going to be a syntax error.

These are the other XML Syntax Rules for you to look up. :)

For further reference, it is advisable that you try to learn from mistakes and make many trial-and-errors, because it was a fun learning, that we can add anything we want. 

Thanks for stopping by, anyway ^___^


Post a Comment