xml Flashcards
What does XML stand for?
o A) Extensible Markup Language
o B) Extra Markup Language
o C) Extended Markup Language
o D) Example Markup Language
A
Which of the following is a valid XML declaration?
o A) <?xml version=”1.0”?>
o B) <xml>
o C) <?xml version="1.0" encoding="UTF-8"?>
o D) Both A and C</xml>
Both A and C
What is the root element in an XML document?
o A) The first child element
o B) The last element
o C) The main container of the document
o D) Any element that has children
C
Which of the following is a feature of XML?
o A) It is case-sensitive
o B) It does not allow nested elements
o C) It can only represent text data
o D) It requires a closing tag for all elements
A
Which of the following is NOT a valid XML element name?
o A) <item>
o B) <1item>
o C) <Item>
o D) <item_1></item_1></Item></item>
B
What is the purpose of an XML namespace?
o A) To define the version of XML
o B) To avoid element name conflicts
o C) To specify encoding
o D) To format the XML document
B
Which symbol is used to denote a comment in XML?
o A) <!-- comment -->
o B) /* comment */
o C) # comment
o D) // comment
A
Which of the following is a valid XML structure?
o A) <note><to>Tove</to><from>Jani</from></note>
o B) <note><to>Tove<from>Jani</note>
o C) <note><to>Tove</from><from>Jani</to></note>
o D) <note><to>Tove</to><from>Jani</from></note></from></to></note></from></to></note>
A
What is the purpose of the XML Document Object Model (DOM)?
o A) To define XML syntax
o B) To represent XML documents in a tree structure
o C) To validate XML documents
o D) To transform XML documents
B
Which XML parser reads the entire document into memory?
o A) SAX Parser
o B) DOM Parser
o C) StAX Parser
o D) JSON Parser
B
What is an XML element?
o A) A single piece of data
o B) A structure containing data and tags
o C) A comment within an XML document
o D) A declaration of XML version
B
Which of the following is true about XML attributes?
o A) They can be omitted
o B) They must be unique
o C) They can contain multiple values
o D) They cannot be used in elements
A
What is the correct way to define a namespace in XML?
o A) <element xmlns=”http://example.com”
o B) <element xmlns=”example.com”
o C) <element namespace=”http://example.com”
o D) <element ns=”http://example.com”
A
Which file extension is commonly used for XML files?
o A) .txt
o B) .xml
o C) .data
o D) .html
B
What is the purpose of XML comments?
o A) To include metadata
o B) To make XML files smaller
o C) To improve readability
o D) To define namespaces
C
What is the main difference between XML and HTML?
o A) XML is for data storage, HTML is for web pages
o B) XML is more complex than HTML
o C) XML cannot have attributes, while HTML can
o D) XML is not case-sensitive, while HTML is
A
Which of the following is a characteristic of XML?
o A) It is limited to textual data
o B) It can represent complex data structures
o C) It requires a specific syntax
o D) It is not extensible
B
What is the purpose of the encoding attribute in the XML declaration?
o A) To specify the XML version
o B) To define the character set used in the document
o C) To indicate the document type
o D) To specify the namespace
B
What is the purpose of an XML stylesheet?
o A) To define XML syntax
o B) To modify the structure of XML
o C) To format XML for presentation
o D) To validate XML data
C
What does the xmlns attribute define in XML?
o A) The version of XML
o B) The character encoding
o C) The XML namespace
o D) The document type
C
Which of the following elements is required in an XML document?
o A) At least one element
o B) A root element
o C) A closing tag
o D) A declaration
B
What is the main advantage of using XML over other data formats?
o A) It is binary and compact
o B) It is human-readable and machine-readable
o C) It is limited to text data
o D) It is not extensible
B
Which of the following is a valid XML comment?
o A) <!-- This is a comment -->
o B) // This is a comment
o C) # This is a comment
o D) /* This is a comment */
A
Which of the following is true about XML attributes?
o A) They can have multiple values
o B) They are always required
o C) They can provide additional information about elements
o D) They cannot be used in elements
C