Introduction to XML
SECTION 1 ( output questions )
Email address *
Answer the following questions:
1. What is XML?
Ans. XML stands for eXtensible Markup Language (XML) which is a markup language that
allows encoding of documents using a predefined set of rules which is both human-readable
and machine-readable

2. State three characteristics of XML.
Ans. The three characteristics of HTML are:
i. XML is extensible. It permits the client to make his own tags and record structure.
ii. XML can be utilized to store information. Applications could be composed to store and recover data.
iii. XML may be utilized to trade information.

3. State the differences between HTML and XML.
Ans. Difference between HTML and XML:
HTML is used to display data and to focus on formatting of data.
HTML tags are predefined. XML tags are not predefined. It is possible to create and define new tags as per your needs.
HTML tags may or may not have closing tags. (Container tags and Empty tags)
HTML tags are not case sensitive.

XML tags are case sensitive.
XML tags must have a closing tag. (only container tags are allowed)
XML is used to describe data and focus on what data is.

4. What do you understand by the term XML element?
Ans. XML elements are tags that forms a XML document. There are no predefined tags in XML unlike HTML. You need to define your own tags in XML.

5. “XML tags are case sensitive” explain the comment with the help of an example.
Ans. XML tags are case sensitive unlike HTML tags which are not case sensitive. For example in HTML the tag <FONT> and <font> is one and the same. But in XML such tags are treated separately. Thus the tag <Message> is different from the tag <MESSAGE>. Also note that the opening and closing tags must be written with the same case. For example:
<Message>This is incorrect</message>
<MESSAGE>This is correct</ MESSAGE >

6. What are empty XML elements? Give an example.
Ans. An empty XML element document that is used to create a tag without any content.
For example if the <message> tag is to be specified without any content. It is valid to write
the tags as:
It can be written like this as well:
<message />
This sort of element syntax is called self-closing.

7. State the naming rules of XML elements.
Ans. XML elements must follow these naming rules:
• Names can contain letters, numbers but no special characters. Thus <state1>, <sta1te>, and <topper5> are valid but <state@>, <sta%te>, <tx,r> and <topper#> are invalid.
• Names cannot start with a number. Thus <1state> is invalid.
• Names cannot contain spaces. Thus <first name> and <last name> are invalid tags.
• Any name can be used, no words are reserved.

8. What are attributes in XML?
Ans. XML attributes are used to describe XML elements, or to provide additional information about elements. As you have already seen that in HTML, attributes provide additional information about elements. For example:
You can see that the BGCOLOR attribute changes the background colour of the web page to GREEN.
You can even create your own attributes in XML. The attribute values in XML must always be quoted, which may be either single or double quotes. For example in XML a person’s sex, can
be written as:
<person sex=“female”>
or written as:
<person sex=‘female’>

Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy