MOTOSHARE 🚗🏍️

Rent Bikes & Cars Directly from Owners

Motoshare connects vehicle owners with people who need bikes and cars on rent. Owners earn from idle vehicles, and renters get flexible ride options.

Visit Motoshare

Top 50 Xml Interview Questions with Answers

Uncategorized
Xml Interview Questions with Answers

1. Which of the following is NOT a valid XML tag?

a) <tag>
b) </tag>
c) <tag>;
d) <tag/>

Answer: c) <tag>;

2. What does XML stand for?

a) Extended Markup Language
b) Extensible Markup Language
c) Executable Markup Language
d) Encrypted Markup Language

Answer: b) Extensible Markup Language

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

a) xml version="1.0" encoding="UTF-8" ?>
></tag>
b) xml version="1.0" ?>
></tag>
c) xml version="1.0" encoding="UTF-8" ?>
d) xml version="1.0" encoding="UTF-8"?>
/>

Answer: c) xml version=”1.0″ encoding=”UTF-8″ ?>

4. Which of the following is NOT a valid XML entity?

a) &
b) <
c) >
d) &#

Answer: d) &#

5. Which of the following is used to define a namespace in XML?

a) <tag>
b) xmlns
c) </tag>
d) <tag/>

Answer: b) xmlns

6. Which of the following is NOT a valid XML attribute?

a) value
b) name
c) content
d) id

Answer: c) content

7. Which of the following is used to declare an XML schema?

a) DOCTYPE>
b) xml>
c) ELEMENT>
d) <xs:schema>

Answer: d) <xs:schema>

8. Which of the following is used to represent a comment in XML?

a) –>
b) //
c) /* */
d) ;

Answer: a) –>

9. Which of the following is NOT a valid XML data type?

a) string
b) boolean
c) integer
d) double

Answer: d) double

10. Which of the following is used to define the root element in XML?

a) &lt;/root&gt;
b) ELEMENT&gt;
c) &lt;root&gt;
d) &lt;root/&gt;

Answer: c) <root>

11. Which of the following is used to define an element in XML?

a) ELEMENT&gt;
b) xml&gt;
c) &lt;/tag&gt;
d) &lt;tag/&gt;

Answer: a) ELEMENT>

12. Which of the following is used to indicate the end of an XML document?

a) &lt;/xml&gt;
b) xml&gt;
c) &lt;/tag&gt;
d) &lt;tag/&gt;

Answer: d) <tag/>

13. Which of the following is used to include external entities in XML?

a) ENTITY>
b) DOCTYPE>
c) CDATA[ ]]>
d) xml version=”1.0″ ?>

Answer: b) DOCTYPE>

14. Which of the following is used to define an attribute in XML?

a) ELEMENT&gt;
b) &lt;attribute&gt;
c) &lt;/tag&gt;
d) &lt;tag/&gt;

Answer: d) <tag/>

15. Which of the following is used to define an XML entity?

a) ELEMENT&gt;
b) CDATA[ ]]&gt;
c) ENTITY&gt;
d) &lt;/tag&gt;

Answer: c) ENTITY>

16. Which of the following is NOT a valid XML parser?

a) DOM
b) SAX
c) XPath
d) XSLT

Answer: c) XPath

17. Which of the following is used to select elements in XML?

a) DOM
b) SAX
c) XPath
d) XSLT

Answer: c) XPath

18. Which of the following is used to transform XML data into another format?

a) DOM
b) SAX
c) XPath
d) XSLT

Answer: d) XSLT

19. Which of the following is used to define an XML document type?

a) ELEMENT>
b) DOCTYPE>
c) CDATA[ ]]>
d)

Answer: b) DOCTYPE>

20. Which of the following is used to insert special characters in XML?

a) CDATA[ ]]&gt;
b) ENTITY&gt;
c) &amp;nbsp;
d) &lt;xml:lang&gt;

Answer: c)  &nbsp;

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

a) content-type
b) position
c) order
d) id

Answer: d) id

22. Which of the following is used to specify the version of XML being used?

a) &lt;xml:lang&gt;
b) xml version="1.0" ?&gt;
c) CDATA[ ]]&gt;
d) DOCTYPE&gt;

Answer: b) xml version=”1.0″ ?>

23. Which of the following is used to define an XML element as empty?

a) &lt;/tag&gt;
b) xml&gt;
c) ELEMENT&gt;
d) &lt;tag/&gt;

Answer: d) <tag/>

24. Which of the following is used to include JavaScript in an XML document?

a) &lt;script&gt;
b) CDATA[ ]]&gt;
c) ENTITY&gt;
d) xml version="1.0" ?&gt;

Answer: b) CDATA[ ]]>

25. Which of the following is used to include CSS in an XML document?

a) &lt;style&gt;
b) /**&lt;br&gt;
c) ELEMENT&gt;
d) &lt;tag/&gt;

Answer: a) <style>

26. Which of the following is used to indicate a processing instruction in XML?

a) ?>
b) ELEMENT>
c) CDATA[ ]]>
d) xml version=”1.0″ ?>

Answer: a) ?>

27. Which of the following is used to eliminate unnecessary white space in an XML document?

a) &lt;xml:space&gt;
b) CDATA[ ]]&gt;
c) DOCTYPE&gt;
d) &lt;tag/&gt;

Answer: a) <xml:space>

28. Which of the following is NOT a valid XML character data type?

a) CDATA
b) PCDATA
c) DTD
d) ENTITY

Answer: c) DTD

29. Which of the following is used to reference an external DTD in XML?

a) DOCTYPE&gt;
b) CDATA[ ]]&gt;
c) &amp;lt;
d) &lt;/tag&gt;

Answer: a) DOCTYPE>

30. Which of the following is used to define the encoding of an XML document?

a) &lt;xml:encoding&gt;
b) xml version="1.0" encoding="UTF-8" ?&gt;
c) CDATA[ ]]&gt;
d) ELEMENT&gt;

Answer: b) xml version=”1.0″ encoding=”UTF-8″ ?>

31. Which of the following is NOT a valid XML schema data type?

a) boolean
b) string
c) decimal
d) character

Answer: d) character

32. Which of the following is used to define the occurrence of an XML element?

a) minOccurs
b) maxOccurs
c) ENTITY>
d) ELEMENT>

Answer: a) minOccurs

33. Which of the following is used to specify a default value for an XML attribute?

a) default
b) ELEMENT&gt;
c) CDATA[ ]]&gt;
d) &lt;tag/&gt;.

Answer: a) default

34. Which of the following is used to specify a unique attribute in XML?

a) unique
b) ELEMENT>
c) CDATA[ ]]>
d) ENTITY>

Answer: a) unique

35. Which of the following is used to specify the maximum length of an XML string?

a) length
b) ELEMENT&gt;
c) CDATA[ ]]&gt;
d) &lt;tag/&gt;

Answer: a) length

36. Which of the following is used to specify the minimum length of an XML string?

a) minLength
b) ELEMENT&gt;
c) CDATA[ ]]&gt;
d) &lt;tag/&gt;

Answer: a) minLength

37. Which of the following is used to specify the format of an XML string?

a) pattern
b) ELEMENT&gt;
c) CDATA[ ]]&gt;
d) &lt;tag/&gt;

Answer: a) pattern

38. Which of the following is used to define a choice of XML elements?

a) choice
b) ENTITY>
c) CDATA[ ]]>
d) ELEMENT>

Answer: a) choice

39. Which of the following is used to define a sequence of XML elements?

a) sequence
b) CDATA[ ]]>
c) attribute
d) ELEMENT>

Answer: a) sequence

40. Which of the following is used to specify the namespace of an XML element?

a) xmlns
b) ELEMENT>
c) CDATA[ ]]>
d) ENTITY>

Answer: a) xmlns

41. Which of the following is used to specify the target namespace of an XML schema?

a) targetNamespace
b) ELEMENT>
c) CDATA[ ]]>
d) ENTITY>

Answer: a) targetNamespace

42. Which of the following is used to specify the namespace prefix in an XML document?

a) prefix
b) xmlns
c) attribute
d) ELEMENT>

Answer: b) xmlns

43. Which of the following is used to define an XML element as optional?

a) minOccurs="0"
b) maxOccurs="1"
c) ELEMENT&gt;
d) &lt;tag/&gt;

Answer: a) minOccurs=”0″

44. Which of the following is used to specify the order of XML elements?

a) sequence
b) choice
c) minOccurs
d) maxOccurs

Answer: c) minOccurs

45. Which of the following is used to define an XML element as required?

a) minOccurs="1"
b) maxOccurs="1"
c) ELEMENT&gt;
d) &lt;tag/&gt;

Answer: a) minOccurs=”1″

46. Which of the following is used to define a XML element as repeating?

a) maxOccurs="unbounded"
b) minOccurs="1"
c) &lt;tag/&gt;
d) ELEMENT&gt;

Answer: a) maxOccurs=”unbounded”

47. Which of the following is used to reference an XML schema in an XML document?

a) xsi:schemaLocation
b) targetNamespace
c) xmlns
d) &lt;tag/&gt;

Answer: a) xsi:schemaLocation

48. Which of the following is used to define an XML element as empty or containing only whitespace?

a) whiteSpace
b) ELEMENT&gt;
c) CDATA[ ]]&gt;
d) &lt;tag/&gt;

Answer: a) whiteSpace

49. Which of the following is used to define the length of an XML attribute?

a) length
b) minOccurs
c) maxOccurs
d) ELEMENT>

Answer: a) length

50. Which of the following is used to define the minimum value of an XML attribute?

a) minInclusive
b) maxInclusive
c) minOccurs
d) maxOccurs

Answer: a) minInclusive

Ashwani Kumar
Latest posts by Ashwani Kumar (see all)
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x