Rules for the syntax of XML:
As you know, HTML is quite forgiving when it comes to tag placement, missing tags, and attribute values. For ex:- A web browser will correctly interpret an HTML page even if you forget to put a closing tag, like :-
<b><i>Bold with Italic</b></i>
XML Elements Must be Properly Nested:
<b><i>Bold with Italic</i></b>
- 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 know, HTML is quite forgiving when it comes to tag placement, missing tags, and attribute values. For ex:- A web browser will correctly interpret an HTML page even if you forget to put a closing tag, like :-
<p>I am MaHi.In XML, all elements must have a closing tag:
<li>I iive in surat.
<p>I am MaHi</p>In HTML, tags are not case sensitive. you can use a tag like "<head>", or "<Head>", or "<HEAD>". They all are valid. But in XML, "<head>", or "<Head>", or "<HEAD>" will be three different tags because XML Tags are case sensitive. So you must write your opening and closing tags with the same case:
<li>I live in surat</li>
<HEAD>This is incorrect</head>In HTML, even the elements are improperly nested, it may still work.:
<head>This is correct</head>
<b><i>Bold with Italic</b></i>
XML Elements Must be Properly Nested:
<b><i>Bold with Italic</i></b>
No comments:
Post a Comment