Skip to main content

Web Services Development MCQs with Answers

Practice important Web Services Development MCQs with answers and explanations.

Chapter: 11
Q301:
Which of the following best describes an XML document tree?
A. Root, branch, leaves
B. Node, edge, vertex
C. Source, target, link
D. Parent, child, sibling
Correct Answer: D
Chapter: 12
Q302:
What is XML validation?
A. Checking well-formed structure
B. Ensuring all elements exist
C. Checking against a DTD
D. Parsing tags
Correct Answer: C
Chapter: 12
Q303:
Which of the following is NOT a predefined XML entity?
A. <
B. >
C. '
D. $
Correct Answer: D
Chapter: 12
Q304:
An XML document that adheres to the predefined rules but lacks a DTD is considered?
A. Valid
B. Well-formed
C. Invalid
D. Structured
Correct Answer: B
Chapter: 12
Q305:
In XML, attributes are declared inside which tag?
A. The closing tag
B. The root tag
C. The start tag
D. The DTD tag
Correct Answer: C
Chapter: 12
Q306:
Which of the following represents parsed character data in XML?
A. CDATA
B. PCDATA
C. ENTITY
D. ATTRIBUTE
Correct Answer: B
Chapter: 12
Q307:
Which XML declaration would be used for an element that contains only parsed character data?
A. <!ELEMENT element-name (CDATA)>
B. <!ELEMENT element-name ANY>
C. <!ELEMENT element-name EMPTY>
D. <!ELEMENT element-name (#PCDATA)>
Correct Answer: D
Chapter: 12
Q308:
Which of the following is an example of an empty element in XML?
A. <hr></hr>
B. <message>Text</message>
C. <br />
D. <to>Text</to>
Correct Answer: C
Chapter: 12
Q309:
In DTD, which attribute type allows the value to be a unique identifier?
A. CDATA
B. ID
C. IDREF
D. ENTITY
Correct Answer: B
Chapter: 12
Q310:
Fill in the blank: In XML, attributes provide ________ about elements.
A. extra functionality
B. extra information
C. parsed character data
D. predefined entities
Correct Answer: B
Chapter: 12
Q311:
Fill in the blank: In DTD, the keyword _______ is used to declare zero or one occurrence of an element.
A. ANY
B. PCDATA
C. IDREF
D. ? (question mark)
Correct Answer: D
Chapter: 12
Q312:
Which type of attribute in XML DTD ensures a default value for the attribute?
A. #FIXED
B. #IMPLIED
C. #REQUIRED
D. CDATA
Correct Answer: A
Chapter: 12
Q313:
What does XML Schema describe?
A. The appearance of HTML elements
B. The structure of an XML document
C. The style of a website
D. The function of a server
Correct Answer: B
Chapter: 12
Q314:
What is the purpose of the targetNamespace attribute in an XML schema?
A. To define the data type for elements
B. To declare the root element
C. To specify the default namespace
D. To define the namespace of elements
Correct Answer: D
Chapter: 12
Q315:
In XML, which is used to provide information that is not relevant to the data?
A. Child elements
B. Attributes
C. Elements
D. None of the above
Correct Answer: B
Chapter: 12
Q316:
Which element is the root of every XML Schema document?
A. xs:schema
B. xs:root
C. <schema>
D. xs:element
Correct Answer: A
Chapter: 12
Q317:
Which of the following is NOT a problem with attributes in XML?
A. Cannot contain multiple values
B. Cannot describe structures
C. Difficult to manipulate by code
D. Can describe relationships
Correct Answer: D
Chapter: 12
Q318:
Which response header content type must be set when generating XML with PHP?
A. text/plain
B. text/xml
C. application/xml
D. application/json
Correct Answer: B
Chapter: 12
Q319:
In XML, how are entities declared?
A. Using <element>
B. Using <!ENTITY>
C. Using <?xml?>
D. Using <xs:entity>
Correct Answer: B
Chapter: 12
Q320:
In an XML document, which of the following best describes an internal entity declaration?
A. Declares entities inside the document
B. Declares entities outside the document
C. Declares attributes
D. Declares child elements
Correct Answer: A

Test Your Knowledge

Take a timed quiz on Web Services Development

🚀 Start Quiz Now