
Q1
Q1 What is the primary purpose of XML?
To create dynamic web applications
To store and transport structured data
To design database schemas
To define styling rules for HTML pages
Q2
Q2 Which of the following is true about XML?
XML is case-sensitive
XML tags must be predefined
XML is used only for web development
XML is a binary format
Q3
Q3 Which of the following is a feature of XML?
Platform-dependent
Case-insensitive
Self-descriptive structure
Binary data format
Q4
Q4 Which of the following best describes a well-formed XML document?
Uses predefined tags
Has a root element and properly nested tags
Can contain unclosed tags
Uses only lowercase letters for tag names
Q5
Q5 What is the key difference between XML and HTML?
XML is case-sensitive, HTML is not
HTML is stricter with syntax than XML
XML is only used for styling
XML replaces HTML in modern web development
Q6
Q6 How does XML help in data exchange between applications?
By defining the user interface
By providing a platform-specific binary format
By using a structured text-based format
By executing application logic
Q7
Q7 Which of the following statements about XML is correct?
XML requires predefined tags
XML allows user-defined tags
XML is used for styling web pages
XML is a compiled language
Q8
Q8 Which of the following XML statements is correctly formatted?
This is valid XML
This is
This is valid XML>
This is valid /data>
Q9
Q9 An XML document is not loading properly due to a parsing error. What is the most likely cause?
The XML file contains unclosed tags
The XML document uses single quotes instead of double quotes
The XML file is missing CSS styles
The XML document has too many attributes
Q10
Q10 Which character is used to define an XML attribute?
@
#
=
$
Q11
Q11 Which of the following must an XML document have to be well-formed?
A single root element
Predefined tags
A DOCTYPE declaration
Only uppercase tag names
Q12
Q12 In XML, attributes must always be enclosed within what?
Parentheses
Double or single quotes
Brackets
Asterisks
Q13
Q13 What is the correct way to comment in an XML document?
<!-- This is a comment -- >
/* This is a comment */
// This is a comment
{# This is a comment #}
Q14
Q14 Which of the following is TRUE about XML tag names?
They can start with numbers
They can include spaces
They can include special characters
They are case-sensitive
Q15
Q15 What is the purpose of the XML prolog?
It defines the structure of the document
It contains metadata about the XML file
It specifies the XML version and encoding
It declares the document type
Q16
Q16 Which of the following statements is TRUE about empty XML elements?
They must be explicitly closed
They can remain unclosed
They do not support attributes
They are not allowed in XML
Q17
Q17 What happens if an XML document contains multiple root elements?
The document is still valid
The parser throws an error
It is ignored by browsers
It will automatically merge root elements
Q18
Q18 Which of the following is a correctly formatted XML attribute?
<person name=John>
<person name='John'>
<person name="John">
<person name=John">
Q19
Q19 An XML document fails to load because of an attribute error. What is the most likely issue?
The attribute is missing
The attribute is not enclosed in quotes
The attribute contains numbers
The attribute is written in lowercase
Q20
Q20 What is an XML element?
A predefined keyword in XML
A component that contains data
A variable in XML
A tag used for styling
Q21
Q21 Which of the following is a valid XML element name?
<123name>
<name-value>
<xmlData>
<first name>
Q22
Q22 What is the difference between XML elements and attributes?
Attributes store additional information, elements store data
Attributes store data, elements store metadata
Elements and attributes are interchangeable
Attributes are optional, elements are mandatory
Q23
Q23 How do you represent an empty element in XML?
<emptyElement></emptyElement>
<emptyElement/>
<emptyElement></>
<emptyElement>
Q24
Q24 What happens if an XML element contains multiple attributes with the same name?
XML allows duplicate attributes
The XML document remains valid
The parser throws an error
The duplicate attribute is ignored
Q25
Q25 What is the primary purpose of XML namespaces?
To define unique element names
To store attributes
To validate XML documents
To define data types
Q26
Q26 How is an XML namespace declared?
xmlns="http://example.com"
namespace="example"
<namespace>http://example.com</namespace>
<xmlns>example.com</xmlns>
Q27
Q27 Which of the following XML statements correctly uses an attribute?
<user id="123">John</user>
<user id:123>John</user>
<user=id>John</user>
<user (id=123)>John</user>
Q28
Q28 Identify the error in the following XML snippet:
<person age='30' age='40'>John</person>
No error
Duplicate attributes
Invalid tag name
Incorrect closing tag
Q29
Q29 Why does the following XML snippet cause an error?
<name>John <age>30</name>
Missing root element
Unclosed tag
Mismatched tags
Invalid characters
Q30
Q30 What is the likely issue in the following XML snippet?
<user id=123>
Attribute not enclosed in quotes
Incorrect tag name
Missing root element
Too many attributes

