XML MCQs
1. What does XML stand for?
- Extensible Markup Language
- Extensible Multimedia Language
- Extended Markup Language
- Expanded Media Language
Correct Answer: a. Extensible Markup Language
2. What is the purpose of XML?
- To store and transport data
- To create multimedia content
- To design websites
- To create executable files
Correct Answer: a. To store and transport data
3. Which of the following is a valid XML syntax?
- <name>John</name><age>25</age>
- <person><name>John</person><age>25</age></person>
- <person><name>John</name><age>25</age></person>
- <person name="John" age="25"/>
Correct Answer: c. <person><name>John</name><age>25</age></person>
4. What is the purpose of XML namespaces?
- To distinguish between elements that share the same name
- To define new elements and attributes
- To include external files
- To define transformations
Correct Answer: a. distinguish between elements that share the same name
5. Which of the following is a valid XML attribute?
- <person name="John" age="25">
- <person><name>John</name><age>25</age></person>
- <person name="John"><age>25</age></person>
- <person><name value="John"/><age value="25"/></person>
Correct Answer: a. <person name="John" age="25">
6. What is the purpose of an XML schema?
- To validate XML documents
- To define transformations
- To include external files
- To differentiate between elements with the same name
Correct Answer: a. To validate XML documents
7. Which of the following is a valid XML schema language?
- XLS
- XSD
- XLST
- XSL-FO
Correct Answer: b. XSD
8. Choose a valid XPath expression from the given options.
- <person><name>John</name><age>25</age></person>
- /person/name
- person[@name="John"]
- person.age
Correct Answer: b. /person/age
9. The purpose of an XSLT is ______ .
- to transform XML documents into different formats.
- to validate XML documents.
- to define transformations.
- to differentiate between elements with the same name.
Correct Answer: a. To transform XML documents into different formats
10. Which of the following is a valid XSLT element?
- <transform>
- <xsl:if>
- <choose>
- <loop>
Correct Answer: b. <xsl:if>
11. Which of the following is a valid XSL-FO element?
- <table>
- <div>
- <span>
- <img>
Correct Answer: a. <table>
12. What is the purpose of an XLink?
- To link to external resources
- To define transformations
- To include external files
- To differentiate between elements with the same name
Correct Answer: a. To link to external resources
13. Which of the following is the correct syntax for an XML comment?
- <!-- This is a comment -->
- # This is a comment
- <This is a comment>
- !-- This is a comment –
Correct Answer: a. <!-- This is a comment -->
14. Which of the following is NOT a valid XML syntax rule?
- XML tags are case-sensitive.
- XML elements must be properly nested.
- Every valid XML document must contain exactly one root element.
- XML attributes must be enclosed in single quotes.
Correct Answer: d. XML attributes must be enclosed in single quotes
15. Which of the following is a valid XML element?
- <book>Hello World!</book>
- <book><title>Hello World!</title><book>
- <book title="Hello World!" />
- <book>Hello World!</book><book>Another book</book>
Correct Answer: b. <book><title>Hello World!</title><book>
16. What is the purpose of an XML namespace?
- To define a set of tags and attributes for use in an XML document
- To provide a unique identifier for an XML document
- To distinguish elements and attributes that may have the same name but different meanings
- To specify the character encoding of an XML document
Correct Answer: c. To distinguish elements and attributes that may have the same name but different meanings
17. Which of the following is NOT a valid XML datatype?
- string
- integer
- boolean
- date
Correct Answer: d. date
18. What is the purpose of a DTD in XML?
- To define the structure and elements of an XML document.
- To validate an XML document against a set of rules
- To specify the character encoding of an XML document
- To define a set of tags and attributes for use in an XML document
Correct Answer: a. To define the structure and elements of an XML document.
19. What is the purpose of the CDATA section in an XML document?
- To enclose text that parsers should ignore
- To define a set of tags and attributes for use in an XML document
- To specify the character encoding of an XML document
- To enclose text that may contain characters with special meaning in XML
Correct Answer: d. To enclose text that may contain characters with special meaning in XML
20. Choose the correct statement.
- All XML elements must have closing tags.
- All XML elements must be in lowercase.
- All XML elements must have a DTD.
- All of the above.
Correct Answer: a. All xml elements must have closing tags
21. Which of the following programs support XML and XML applications?
- Internet Explorer 5.5
- RealPlayer
- Both a and b
- None of these
Correct Answer: a. Internet Explorer 5.5
22. Choose the predefined attributes.
- xml:lang
- xml:space
- Both a and b
- None of these
Correct Answer: c. Both a and b
23. Which feature is used by XML?
- HTML
- XHTML
- VML
- SGML
Correct Answer: d. SGML
24. An XML document is a string of _______
- HTML character codes
- XML codes
- ASCII codes
- Characters
Correct Answer: d. Characters
25. In XML document, how to denote a tag markup.
- <, >
- <!--, -->
- <#, >
- @, @
Correct Answer: a. <, >
26. How many types of tags are present in the XML document?
- 2
- 3
- 4
- 5
Correct Answer: 3
27. Choose the correct XML declaration.
- <xml version="1.0" encoding="UTF-8"/>
- <xml version="1.0" encoding="UTF-8"></xml>
- <?xml version="1.0" encoding="UTF-8"?>
- <?xml type="document" version="1.0" encoding="UTF-8"?>
Correct Answer: c. <?xml version="1.0" encoding="UTF-8"?>
28. Full form of DTD is _______
- Document Type Declaration
- Data Type Definition
- Document Type Definition
- Document To Declaration
Correct Answer: c. Document Type Definition
29. Which of the following is true about DTD(Document Type Definition).
- It is used to define the style and presentation of an XML document.
- It is used to define the structure and elements of an XML document.
- It is used to define the data types of an XML document.
- None of the above.
Correct Answer: b. It is used to define the structure and elements of an XML document.
30. In XML, what is the full form of SGML?
- Standard Generalized Markup Language
- Standard General Markup Language
- Strainer Generalized Markup Language
- Standard Global Markup Language
Correct Answer: a. Standard Generalized Markup Language
31. Which of the following is not an attribute type?
- StringType
- ArrayType
- TokenizedType
- EnumeratedType
Correct Answer: b. ArrayType
32. What is the use of SAX in XML documents?
- Defining the format of an XML document
- Validating the XML file
- Parsing XML documents
- None of the above
Correct Answer: c. Parsing XML documents
33. There are ___ types of XML Database.
- 4
- 3
- 2
- 1
Correct Answer: c. 2
34. What is the full form of SAX?
- Simple API for XML
- SafeAPI for XML
- Simple Application for XML
- None of these
Correct Answer: a. Simple API for XML
35. Full form of XSNL ______
- XML Simple Neutral Language
- XML Software Neutral Language
- XML Search Natural Language
- XML Search Neutral Language
Correct Answer: d. XML Search Neutral Language
36. What is XSNL?
- It helps to act between the "meta-search interface" and "XML document".
- It helps to act between the "meta-search interface" and "targeted system".
- It helps to act between the "XML document" and "targeted system".
- None of these
Correct Answer: b. It helps to act between the "meta-search interface" and "targeted system”.
37. How can graphics be stirred in an XML document?
- Using XLink
- Using XPointer
- Both A and B
- None of the above
Correct Answer: c. Both A and B
38. Choose the XLink attribute, which defines the URL to link to.
- xlink:path
- xlink:url
- xlink:src
- xlink:href
Correct Answer: d. xlink:href
39. _____ is the XML object that requests data from the web server.
- XMLHttpReq
- XMLHttpRequest
- XMLHttpsReq
- XMLHttpsRequest
Correct Answer: b. XMLHttpRequest
40. Choose the correct relation among XML, SGML and HTML.
- XML is the direct subset of SGML.
- SGML is an application of HTML.
- XML is a kind of dynamic HTML.
- XML and SGML are both the same.
Correct Answer: a. XML is the direct subset of SGML.
41. What is a namespace in XML?
- It defines the structure of an XML document.
- It defines the elements and attributes of an XML document.
- It provides a way to avoid naming conflicts in XML documents.
- It provides a way to specify the layout and presentation of an XML document.
Correct Answer: c. It provides a way to avoid naming conflicts in XML documents.
42. Choose the correct option for the XML parser.
- A program that reads XML documents and validates their structure and content.
- A program that creates XML documents from scratch.
- A program that converts XML documents into another format, such as HTML or JSON.
- A program that optimizes the performance of XML documents.
Correct Answer: a. A program that reads XML documents and validates their structure and content.
43. Which of these is not a valid XML element name?
- MyElement
- my-element
- my:element
- 123element
Correct Answer: d. 123element
44. Choose the correct attribute type in XML schema.
- xs:string
- xs:integer
- xs:Boolean
- All of the above
Correct Answer: d. All of the above
45. Which of the following is not an acceptable prefix for an XML namespace?
- xml
- xs
- http
- xsl
Correct Answer: c. http
46. Which of these functions is not a valid function in XPath?
- length()
- position()
- sum()
- count()
Correct Answer: a. length()
47. Which language is used to find information in an XML document?
- XSLT
- XPath
- XPointer
- XLink
Correct Answer: b. XPath
48. XML is _______.
- Platform independent.
- Language independent.
- Both A and B
- None of these
Correct Answer: c. Both A and B
49. Which is a case-sensitive language?
- HTML
- XML
- Both A and B
- None of these
Correct Answer: b. XML
50. What is the name of the internet language that is utilized to describe the available web services in XML?
- WSDL
- RSS
- RDF
- OWL
Correct Answer: a. WSDL
51. What is an XML namespace?
- A set of names applied to specific spaces within an XML document, such as the head and body.
- A way to identify unique elements and attributes within an XML document.
- A set of names for XML documents about a particular vocabulary
- None of the above.
Correct Answer: b. A way to identify unique elements and attributes within an XML document.
52. What is an NC Name?
- A Non- Colonized Name
- A Non-Conforming Name
- A Non-Common Name
- None of the above
Correct Answer: a. A Non- Colonized Name
53. The proper order to implement XML-based IETMs is as follows:
- Develop DTD, conduct a pilot project, create a modular library and train staff.
- Train staff, convert legacy documents, develop DTD, and create a modular library.
- Conduct pilot program, train staff, create a modular library, develop DTD
- Conduct pilot program, train staff, develop DTD, convert documents, and purchase XML tools.
Correct Answer: c. Conduct pilot program, train staff, create a modular library, develop DTD
54. Which names are considered as aqualified name.
- Any name conforming to the XML Names specification
- A name has a prefix and local name separated by a colon
- A name applying only to qualified elements and attributes
- None of the above
Correct Answer: c. A name applying only to qualified elements and attributes
55. Among the following, which instructs the browser which stylesheet to use?
- <xml-stylesheet type="text/xsl" href="cd.xsl">
- <xml-stylesheet type="text/xsl" xsl="cd.xsl">
- <?xml-stylesheet type="text/xsl" xsl="cd.xsl"?>
- <?xml-stylesheet type="text/xsl" href="cd.xsl"?>
Correct Answer: d. <?xml-stylesheet type="text/xsl" href="cd.xsl"?>
56. Choose the syntax to match the text node (in XSLT).
- <xsl:template match=” text( )” >
- <xsl:template match=” text”>
- <xsl:template match-text=” text”>
- <xsl:template match=text( )>
Correct Answer: a. <xsl:template match=” text( )” >
57. In the XMLT transform, the syntax to match the root node will be_______.
- <xsl:template match=”Document”>
- <xsl:template match=” /” >
- <xsl:template match=”Root”>
- <xsl:template match=”RootNode”>
Correct Answer: b. <xsl:template match=” /” >
58. Which of the following methods can be used for transforming an XML document into another type of document using XSLT?
(i)In the server
(ii)In the client
(iii)With a separate program
- only(i) & (ii)
- only (ii) & (iii)
- only (i) & (iii)
- All are correct
Correct Answer: d. All are correct
59. How does XPath play a role in XSL processing?
- To define the structure of an XML document
- To transform XML documents into other formats
- To query and select specific elements and attributes in an XML document
- None of the above
Correct Answer: c. To query and select specific elements and attributes in an XML document
60. Which XSL formatting object is used to hold the contents of the body of a list item?
- list-item-body
- list-block
- list item
- list-item-label
Correct Answer: a. list-item-body
61. Which attribute is used to define a new namespace?
- XMLNS
- XmlNameSpace
- Xmlns
- XmlNs
Correct Answer: c. Xmlns
62. A textual object is a well-formed XML document if
(i) Taken as a whole, it matches the production-labelled document.
(ii) Each of the parsed entities which are referenced directly or indirectly within the document can be well-formed
- (i) is correct
- (ii)is correct
- both are correct
- none of these
Correct Answer: c. both are correct
63. What does a schema describe?
(i) grammar
(ii) Vocabulary
(iii) structure
(iv) datatype of XML document
- (i) & (ii) are correct
- (i), (iii), (iv) are correct
- (i), (ii), (iv) are correct
- (i), (ii), (iii), (iv) are correct
Correct Answer: d. (i), (ii), (iii), (iv) are correct
64. What makes XML not qualify to be a programming language?
- It contains only data and not any processing instructions.
- It does not have specialized syntax rules.
- It is too flexible and needs more reserved keywords.
- None of these
Correct Answer: a. It contains only data and not any processing instructions.
65. How does XML DOM present an XML Document?
- as a set of objects
- as a tree structure
- as an array of nodes
- none of these
Correct Answer: b. as a tree structures