XML MCQs

1. What does XML stand for?

  1. Extensible Markup Language
  2. Extensible Multimedia Language
  3. Extended Markup Language
  4. Expanded Media Language

Correct Answer: a. Extensible Markup Language


2. What is the purpose of XML?

  1. To store and transport data
  2. To create multimedia content
  3. To design websites
  4. To create executable files

Correct Answer: a. To store and transport data


3. Which of the following is a valid XML syntax?

  1. <name>John</name><age>25</age>
  2. <person><name>John</person><age>25</age></person>
  3. <person><name>John</name><age>25</age></person>
  4. <person name="John" age="25"/>

Correct Answer: c. <person><name>John</name><age>25</age></person>


4. What is the purpose of XML namespaces?

  1. To distinguish between elements that share the same name
  2. To define new elements and attributes
  3. To include external files
  4. To define transformations

Correct Answer: a. distinguish between elements that share the same name


5. Which of the following is a valid XML attribute?

  1. <person name="John" age="25">
  2. <person><name>John</name><age>25</age></person>
  3. <person name="John"><age>25</age></person>
  4. <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?

  1. To validate XML documents
  2. To define transformations
  3. To include external files
  4. 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?

  1. XLS
  2. XSD
  3. XLST
  4. XSL-FO

Correct Answer: b. XSD


8. Choose a valid XPath expression from the given options.

  1. <person><name>John</name><age>25</age></person>
  2. /person/name
  3. person[@name="John"]
  4. person.age

Correct Answer: b. /person/age


9. The purpose of an XSLT is ______ .

  1. to transform XML documents into different formats.
  2. to validate XML documents.
  3. to define transformations.
  4. 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?

  1. <transform>
  2. <xsl:if>
  3. <choose>
  4. <loop>

Correct Answer: b. <xsl:if>


11. Which of the following is a valid XSL-FO element?

  1. <table>
  2. <div>
  3. <span>
  4. <img>

Correct Answer: a. <table>


12. What is the purpose of an XLink?

  1. To link to external resources
  2. To define transformations
  3. To include external files
  4. 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?

  1. <!-- This is a comment -->
  2. # This is a comment
  3. <This is a comment>
  4. !-- This is a comment –

Correct Answer: a. <!-- This is a comment -->


14. Which of the following is NOT a valid XML syntax rule?

  1. XML tags are case-sensitive.
  2. XML elements must be properly nested.
  3. Every valid XML document must contain exactly one root element.
  4. 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?

  1. <book>Hello World!</book>
  2. <book><title>Hello World!</title><book>
  3. <book title="Hello World!" />
  4. <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?

  1. To define a set of tags and attributes for use in an XML document
  2. To provide a unique identifier for an XML document
  3. To distinguish elements and attributes that may have the same name but different meanings
  4. 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?

  1. string
  2. integer
  3. boolean
  4. date

Correct Answer: d. date


18. What is the purpose of a DTD in XML?

  1. To define the structure and elements of an XML document.
  2. To validate an XML document against a set of rules
  3. To specify the character encoding of an XML document
  4. 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?

  1. To enclose text that parsers should ignore
  2. To define a set of tags and attributes for use in an XML document
  3. To specify the character encoding of an XML document
  4. 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.

  1. All XML elements must have closing tags.
  2. All XML elements must be in lowercase.
  3. All XML elements must have a DTD.
  4. 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?

  1. Internet Explorer 5.5
  2. RealPlayer
  3. Both a and b
  4. None of these

Correct Answer: a. Internet Explorer 5.5


22. Choose the predefined attributes.

  1. xml:lang
  2. xml:space
  3. Both a and b
  4. None of these

Correct Answer: c. Both a and b


23. Which feature is used by XML?

  1. HTML
  2. XHTML
  3. VML
  4. SGML

Correct Answer: d. SGML


24. An XML document is a string of _______

  1. HTML character codes
  2. XML codes
  3. ASCII codes
  4. Characters

Correct Answer: d. Characters


25. In XML document, how to denote a tag markup.

  1. <, >
  2. <!--, -->
  3. <#, >
  4. @, @

Correct Answer: a. <, >


26. How many types of tags are present in the XML document?

  1. 2
  2. 3
  3. 4
  4. 5

Correct Answer: 3


27. Choose the correct XML declaration.

  1. <xml version="1.0" encoding="UTF-8"/>
  2. <xml version="1.0" encoding="UTF-8"></xml>
  3. <?xml version="1.0" encoding="UTF-8"?>
  4. <?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 _______

  1. Document Type Declaration
  2. Data Type Definition
  3. Document Type Definition
  4. Document To Declaration

Correct Answer: c. Document Type Definition


29. Which of the following is true about DTD(Document Type Definition).

  1. It is used to define the style and presentation of an XML document.
  2. It is used to define the structure and elements of an XML document.
  3. It is used to define the data types of an XML document.
  4. 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?

  1. Standard Generalized Markup Language
  2. Standard General Markup Language
  3. Strainer Generalized Markup Language
  4. Standard Global Markup Language

Correct Answer: a. Standard Generalized Markup Language


31. Which of the following is not an attribute type?

  1. StringType
  2. ArrayType
  3. TokenizedType
  4. EnumeratedType

Correct Answer: b. ArrayType


32. What is the use of SAX in XML documents?

  1. Defining the format of an XML document
  2. Validating the XML file
  3. Parsing XML documents
  4. None of the above

Correct Answer: c. Parsing XML documents


33. There are ___ types of XML Database.

  1. 4
  2. 3
  3. 2
  4. 1

Correct Answer: c. 2


34. What is the full form of SAX?

  1. Simple API for XML
  2. SafeAPI for XML
  3. Simple Application for XML
  4. None of these

Correct Answer: a. Simple API for XML


35. Full form of XSNL ______

  1. XML Simple Neutral Language
  2. XML Software Neutral Language
  3. XML Search Natural Language
  4. XML Search Neutral Language

Correct Answer: d. XML Search Neutral Language


36. What is XSNL?

  1. It helps to act between the "meta-search interface" and "XML document".
  2. It helps to act between the "meta-search interface" and "targeted system".
  3. It helps to act between the "XML document" and "targeted system".
  4. 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?

  1. Using XLink
  2. Using XPointer
  3. Both A and B
  4. None of the above

Correct Answer: c. Both A and B


38. Choose the XLink attribute, which defines the URL to link to.

  1. xlink:path
  2. xlink:url
  3. xlink:src
  4. xlink:href

Correct Answer: d. xlink:href


39. _____ is the XML object that requests data from the web server.

  1. XMLHttpReq
  2. XMLHttpRequest
  3. XMLHttpsReq
  4. XMLHttpsRequest

Correct Answer: b. XMLHttpRequest


40. Choose the correct relation among XML, SGML and HTML.

  1. XML is the direct subset of SGML.
  2. SGML is an application of HTML.
  3. XML is a kind of dynamic HTML.
  4. XML and SGML are both the same.

Correct Answer: a. XML is the direct subset of SGML.


41. What is a namespace in XML?

  1. It defines the structure of an XML document.
  2. It defines the elements and attributes of an XML document.
  3. It provides a way to avoid naming conflicts in XML documents.
  4. 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.

  1. A program that reads XML documents and validates their structure and content.
  2. A program that creates XML documents from scratch.
  3. A program that converts XML documents into another format, such as HTML or JSON.
  4. 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?

  1. MyElement
  2. my-element
  3. my:element
  4. 123element

Correct Answer: d. 123element


44. Choose the correct attribute type in XML schema.

  1. xs:string
  2. xs:integer
  3. xs:Boolean
  4. 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?

  1. xml
  2. xs
  3. http
  4. xsl

Correct Answer: c. http


46. Which of these functions is not a valid function in XPath?

  1. length()
  2. position()
  3. sum()
  4. count()

Correct Answer: a. length()


47. Which language is used to find information in an XML document?

  1. XSLT
  2. XPath
  3. XPointer
  4. XLink

Correct Answer: b. XPath


48. XML is _______.

  1. Platform independent.
  2. Language independent.
  3. Both A and B
  4. None of these

Correct Answer: c. Both A and B


49. Which is a case-sensitive language?

  1. HTML
  2. XML
  3. Both A and B
  4. 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?

  1. WSDL
  2. RSS
  3. RDF
  4. OWL

Correct Answer: a. WSDL


51. What is an XML namespace?

  1. A set of names applied to specific spaces within an XML document, such as the head and body.
  2. A way to identify unique elements and attributes within an XML document.
  3. A set of names for XML documents about a particular vocabulary
  4. 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?

  1. A Non- Colonized Name
  2. A Non-Conforming Name
  3. A Non-Common Name
  4. None of the above

Correct Answer: a. A Non- Colonized Name


53. The proper order to implement XML-based IETMs is as follows:

  1. Develop DTD, conduct a pilot project, create a modular library and train staff.
  2. Train staff, convert legacy documents, develop DTD, and create a modular library.
  3. Conduct pilot program, train staff, create a modular library, develop DTD
  4. 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.

  1. Any name conforming to the XML Names specification
  2. A name has a prefix and local name separated by a colon
  3. A name applying only to qualified elements and attributes
  4. 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?

  1. <xml-stylesheet type="text/xsl" href="cd.xsl">
  2. <xml-stylesheet type="text/xsl" xsl="cd.xsl">
  3. <?xml-stylesheet type="text/xsl" xsl="cd.xsl"?>
  4. <?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).

  1. <xsl:template match=” text( )” >
  2. <xsl:template match=” text”>

  3. <xsl:template match-text=” text”>
  4. <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_______.

  1. <xsl:template match=”Document”>
  2. <xsl:template match=” /” >
  3. <xsl:template match=”Root”>
  4. <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

  1. only(i) & (ii)
  2. only (ii) & (iii)
  3. only (i) & (iii)
  4. All are correct

Correct Answer: d. All are correct


59. How does XPath play a role in XSL processing?

  1. To define the structure of an XML document
  2. To transform XML documents into other formats
  3. To query and select specific elements and attributes in an XML document
  4. 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?

  1. list-item-body
  2. list-block
  3. list item
  4. list-item-label

Correct Answer: a. list-item-body


61. Which attribute is used to define a new namespace?

  1. XMLNS
  2. XmlNameSpace
  3. Xmlns
  4. 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

  1. (i) is correct
  2. (ii)is correct
  3. both are correct
  4. 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

  1. (i) & (ii) are correct
  2. (i), (iii), (iv) are correct
  3. (i), (ii), (iv) are correct
  4. (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?

  1. It contains only data and not any processing instructions.
  2. It does not have specialized syntax rules.
  3. It is too flexible and needs more reserved keywords.
  4. None of these

Correct Answer: a. It contains only data and not any processing instructions.


65. How does XML DOM present an XML Document?

  1. as a set of objects
  2. as a tree structure
  3. as an array of nodes
  4. none of these

Correct Answer: b. as a tree structures