Total Pageviews

Thursday 28 March 2013

XML Syntax Rules



       All XML Elements Must Have a Closing Tag
      In HTML, some elements do not have to have a closing tag:
      Like <p>This is a paragraph.
       <br>--------------
       XML Tags are Case Sensitive
      XML tags are case sensitive. The tag <Letter> is different from the tag <letter>.
                Example:             <Message>This is incorrect</message>
                                                <message>This is correct</message>
       XML Elements Must be Properly Nested
      <b><i>This text is bold and italic</b></i>[ improper]
<b><i>This text is bold and italic</i></b> [Proper]


       XML Documents Must Have a Root Element
       <root>
  <child>
    <subchild>.....</subchild>
  </child>
</root>
       XML Attribute Values Must be Quoted
       <note date=“ 12/03/2012 ">
   <to>Principal/to>
  <from> MCA Students</from>
</note> 

How to Use XML


How to Use XML
       With XML, data can be stored in separate XML files.
       So you can concentrate on using HTML for layout and display, and be sure that changes in the underlying data will not require any changes to the HTML.
XML Follow Tree Structure
XML documents form a tree structure that starts at "the root" and branches to "the leaves".


XML

XML and HTML were designed with different goals:
       XML was designed to transport and store data, with focus on what data is
       HTML was designed to display data, with focus on how data looks
       HTML is about displaying information, while XML is about carrying information.
       Maybe it is a little hard to understand, but XML does not DO anything.

Example has sender and receiver information

       XML was created to structure, store, and transport information.

<Letter>
<to>                      The Principal                      </to>
<from> A. Ram Prathap Reddy   </from>
<heading>          Application                                         </heading>
<body>                h----------------------------               </body>
</Letter>
In XML we can create our own tags  (like <to> and <from>)
That is because the XML language has no predefined tags.