Oops! It appears that you have disabled your Javascript. In order for you to see this page as it is meant to appear, we ask that you please re-enable your Javascript!

XML Syntax

Last modified on May 26th, 2018 at 2:08 pm

Rule 1:

Root: 

Root Element is the parent of all other nodes.

Example:

<root>
  <First child>
    <First sub child>.</First sub child>
    <Second sub child>.</Second sub child> </First child>
</root>

Rule 2:

XML Pro log:

XML prolog is optional. If XML exists then  XML must come first in the document.

Example:

<?xml version=”1.0″ encoding=”UTF-8?>

Rule 3:

Case Sensitivity:

XML tags are case sensitive.

Example:

<author> sameed </author>

<AUTHOR> sameed <AUTHOR>

In this example both tags representing different tags.


Rule 4:

Attributes values must be qouted.

Example:

Wrong PracticeRight Practice
<book date=12/11/2007>
  <title>Book On XML</title>
</book>
<book date=12/11/2007>
  <title>Book On XML</title>
</book>

Rule 5:

Comment:

Comment are used to give some opinion for better understanding.

Example:

< ! −− this is comment − − >

Rule 6:

Starting and closing of tags:

  • Every tag should have starting and ending.
  • For example <author> is the starting of author tag and </author> is the closing of the author tag.
  • Early starting tag should be late closed and late started tag should be early close. Example is shown in the diagram below.

tags in html


 

Prof. Fazal Rehman Shamil
Researcher, Publisher of International Journal Of Software Technology & Science ISSN: 2616-5325
Instructor, SEO Expert, Web Programmer and poet.
Feel free to contact.