iTech College - Internet Technology, Online Education, E-Learning, Technician Training, Tech Tutorials, Distance Education, Virtual Learning XML Course: XML Syntax (1) - www.itechcollege.com XML Course: XML Syntax (1) - www.itechcollege.com
Free Courses
HTML
JavaScript
CSS
ASP
PHP
JSP
C++
ASP.NET
SQL
AJAX
FTP
XML

courses > XML > XML Syntax (1)

XML Syntax (1)

The syntax of XML is very simple. The following are the sytax rules:

  • A XML document must contain a pair, and only a pair, of root tags
  • All XML elements must have a opening tag and a closing Tag.
  • XML tags are case sensitive.
  • An element in XML can has its child element.
  • All elements in XML must be properly nested within each other.
  • XML attribute values must be quoted.

As you may know that, HTML is quite forgiving when it comes to tag placement, missing tags, and attribute values. A web browser, for example, will correctly interpret an HTML page even if you forget to put a closing tag, like:

<p>Welcome to my website
<li>This is an element of a list

In XML, all elements must have a closing tag:

<firstname>Michael</firstname>
<lastname>Smith</lastname>

In HTML, tags are not case sensitive. you can use a tag like "<table>", or "<TABLE>", or "<Table>". They all are valid. But in XML, "<table>", or "<TABLE>", or "<Table>" will be three different tags because XML Tags are case sensitive. So you must write your opening and closing tags with the same case:

<Description>This is incorrect</description>
<description>This is correct</description>

In HTML, even the elements are improperly nested, it may still work.:

<b><i>This text is bold and italic</b></i>

XML Elements Must be Properly Nested:

<b><i>This text is bold and italic</i></b>

In the example above, "Properly nested" simply means that since the <i> element is opened inside the <b> element, it must be closed inside the <b> element.
XML Documents Must Have a Root Element.



  Back to Index Page
 Next Page:  

XML Introduction
XML Format and Structure
XML Elements
XML Attributes
XML Syntax 1
XML Syntax 2
XML Naming Rules and Practices
XML Using CDATA for Dealing with HTML Tags
Displaying XML into HTML
XML Parser
XML DOM
XMLHttpRequest Object 1
XMLHttpRequest Object 2
XMLHttpRequest Object 3
Create an XML File From a Database 1
Create an XML File From a Database 2
Save XML File on Server


Online Education, Online Training for Your Job, Distance Education, E-learning Programs for Your Career!Online Colleges, Online Universities, E-learning & Distance Education for Your Career! Easy Job Training & Online Courses.


   Email A Friend  
 
Earn Online Degree
for Your Job
I found a job after I earned an online degree!
Online classes for finding a Job. Online College, Online University, Degrees, E-learning school, online certificate Earn your
online degree now!
Online Training
for Good Job
Why I work so hard but earn so little? Why I cannot find a high paying job?
Online training for a Good Jobs. Online Degree, E-learning school, online certificate Go to
online school now!

Copyright ©2024, itechcollege.com. All rights reserved
iTechCollege | About iTech | Contact iTech