XML MCQ - CH - 01 - To - 13
XML MCQ - CH - 01 - To - 13
XML MCQ - CH - 01 - To - 13
Q3. Which of the following is or are supported by XML but not by SGML?
A. DTD Validation
B. XLL linking mechanism
C. XSL for formatting
D. XSD for strong data typing and enforcing constraints
Answer: B, C, D
Q4. Which of the following is or are supported by both SGML and XML?
A. DTD Validation
B. XLL linking mechanism
C. XSL for formatting
D. XSD for strong data typing and enforcing constraints
Answer: A [XML inherits DTD validation from SGML. Other three are specifications included in only in XML]
Q7. Anything that can be done in XML can also be done in SGML, but XML has some advantages over SGML.
Do you agree?
A. Yes
B. No
Answer: A
Q13. Which of the following is or are true about both XML and SGML?
A. Generalized language
B. Documents are self-describing
C. Documents can validated using DTD rules
D. Data types and constraints can be enforced on documents using Schema documents
Answer: A, B, C [Schema validation only supported in XML]
Q15. HTML (also SGML) allows authors to omit the closing tags for many elements. It is a ____________.
A. shortcut technique
B. minimization technique
C. typing technique
D. acceptable technique
Answer: B
Q3. The _________ structure of every XML document contains the actual data used in the document.
Which is appropriate for the blank?
A. logical
B. physical
Answer: B
Q4. Which of the following is or are true about the logical structure of an XML document?
A. It is like a template that tells what elements to include in what order
B. It indicates what a document contains
C. It indicates how a document is built
D. It is composed of all the content used in a document
Answer: A, C
Q5. Which of the following is or are true about the physical structure of an XML document?
A. It is like a template that tells what elements to include in what order
B. It indicates what a document contains
C. It indicates how a document is built
D. It is composed of all the content used in a document
Answer: B, D
Q6. The logical structure of an XML document indicates how a document is built, the physical structure _______________?
Which phrase is the correct for the blank space?
A. why a document is built
B. what a document contains
C. what a document cannot contain
D. when a document can be built
Answer: B [See page 26]
Q8. Which of the following component or components the prologs of an XML document can contain?
A. The XML declaration
B. The document type declaration
C. The processing instruction
D. The root element
Answer: B
Q9. The ______ identifies the version of the XML specification to which the document conforms.
Choose the correct one for the blank.
A. XML declaration
B. document type declaration
C. processing instruction
D. root element
Answer: A
Q10. The ___________ consists of markup code that indicates the grammar rules or DTD (Document Type Definition) for the
particular class of document
Choose the correct one for the blank.
A. XML declaration
B. document type declaration
C. processing instruction
D. root element
Answer: B
Q11. Which is the purpose of the stand-alone attribute in the XML declaration in an XML document?
A. It indicates the version of XML specification to which the document conforms
B. It identifies the character encoding scheme the document uses
C. It identifies whether any markup exist that is external to the document
D. It identifies document element in the XML document
Answer: C
Q12. What are the possible values of stand-alone attribute of the XML declaration in an XML file?
A. yes
B. no
C. true
D. false
Answer: A, B
Q13. Which of the following correctly identifies the correct position of the Document Type Declaration in an XML file?
A. Preceding the XML Declaration
B. Following the XML Declaration
C. Preceding the Document Element
D. Following the Document Element
Answer: B, C
Q14. Which of the following is or are true about the Document Element in an XML document?
A. It is the root element
B. An XML document contains only one Document Element
C. It contains all the data in the XML document
D. It can comprise any number of subelement and external entities
Answer: A, B, C, D
Q15. If you create an entity “Author”, then which one correctly references it?
A. &Author&
B. #Author#
C. &Author#
D. &Author;
Answer: D
Q21. Which character is placed before the entity name to refer a parameter entity?
A. &
B. #
C. %
D. $
Answer: C
Q24. Which of the following quality or qualities a well-formed XML must meet?
A. It matches the definition a document
B. It strictly obeys the rules for defined by DTD
C. It observes the constraints for a well-formed as defined by the XML specification
D. It contains all tags defined in W3C’s recommendation
Answer: A, C [See page 33]
According to above declarations which of the following is or are valid for name element?
A. <name>
<first>Shaz</first>
<last />
</name>
B. <name>
<first></first>
<last>Amin</last
</name>
C. <name>
<first>Shaz</first>
</name>
D. <name>
<last>amin<last>
<first>shaz</last>
</name>
Answer: A, B, D
Q21. Consider the following DTD declarations
<!ELEMENT name ( first, last, middle?) >
<!ELEMENT first (#PCDATA) >
<!ELEMENT last (#PCDATA) >
<!ELEMENT middle (#PCDATA) >
According to above declarations which of the following is or are valid for name element?
A. <name>
<first>Shaz</first>
<last />
<middle>Mohammed</middle>
</name>
B. <name>
<first></first>
<last>Amin</last>
</name>
C. <name>
<first>Shaz</first>
</name>
D. <name>
<last>amin<last>
<first>shaz</last>
</name>
Answer: A, B, D
Q22. Consider the fillowing DTD declarations
<!ELEMENT name ( first| last) >
<!ELEMENT first (#PCDATA) >
<!ELEMENT last (#PCDATA) >
According to above declarations which of the following is or are valid for name element?
A. <name>
<first>Shaz</first>
<last />
</name>
B. <name>
<first></first>
<last>Amin</last
</name>
C. <name>
<first>Shaz</first>
</name>
D. <name>
<last>amin<last>
</name>
Answer: C, D [#PCDATA allows empty content
Q23. You want to test various structures in DTD while tracking variations. Which of the following DTD construct or construct
will help you?
A. CDATA section
B. INGNORE
C. INCLUDE
D. ATTLIST
Answer: B, C [IGNORE and INCLUDE are used to turn certain portion of DTD on or off and thus allows you test variations]
Q24. XML declaration in the Prolog is also a Processing Instruction.
Do you agree?
A. Yes
B. No
Answer: A [PIs are written within <? and ?> and they provide instructions for XML processing Application. In that sense <?xml
….?> is certainly a processing instruction (PI)]
Q25. Consider the following Processing Instruction (PI)
<?AVI CODEC=”VIDEO1” COLORS=”256”?>
Now which one is PI target?
A. AVI
B. CODEC
C. COLORS
D. VIDEO1
Answer: A
Q26. Which of the following is or are the possible values of the RMD attribute in the XML declaration?
A. ALL
B. NONE
C. INTERNAL
D. EXTERNAL
Answer: A, B, C
Q27. You want to indicate the xml processor that it should not process certain portion DTD (internal or external) should not
be processed. Which attribute would use to solve it ino XML declaration?
A. stand-alone
B. encoding
C. RMD
D. Process
Answer: C
Q3. You have written the following script code in your HTML page
<SCRIPT>
alert (“Welcome to my site”);
</SCRIPT>
Which scripting language you are using?
A. JavaScript
B. VBScript
C. Jscript
D. PerlScript
Answer: A [Since default language is JavaScript]
Q4. You want to welcome when your HTML Page is loaded on the browser. Which of the following will work for you?
A. <BODY onload=”alert( “Welcome to my site);”>
B. <BODY alert(“Welecome to my site”);>
C. <SCRIPT FOR=”body” event=”onload”> alert( “Welcome to my site”); </SCRIPT>
D. <SCRIPT FOR=”window” event=”onload”> alert( “Welcome to my site”); </SCRIPT>
Answer: A, D
Q5. ___________ acts a middle layer between the data in an XML document and a display mechanism.
Which one best fits the blank.
A. XSL
B. XSD
C. DTD
D. An XML Parser
Answer: D [An XML Processor]
Q6. XML describes data, ________ instructions for how the processor should display data.
Which one fits the blank correctly?
A. includes
B. does not include
Answer: B
Q9. Which property of an XML DOM parser instance returns the root element of an XML document?
A. root
B. rootElement
C. document
D. documentElement
Answer: D
Q10 and Q11 are based on the following JavaScript code
var xmlDoc = new ActiveXObject( “Microsoft.xmldom” );
xmlDoc.loadXML (“<trainees>” +
“ <trainee>”+
“ <id>10732</id>”+
“ <name>Hasan Abid</name>”+
“ </trainee>”+
“ <trainee>”+
“ <id>10733</id>”+
“ <name>Ruhul Amin</name>”+
“ </trainee>” +
“</trainee>”);
Q10. Which one returns the number of trainee element present in the xml tree?
A. traineeCollection.length
B. traineeCollection.items.length
C. traineeCollection.childNodes.length
D. traineeCollection.childNodes.items.length
Answer: A
Q11. Now which of the following should return the text 10732? [Choose all valid options.]
A. traineeCollection.item(0).firstChild.text
B. traineeCollection.item(0).childNodes.item(0).text
C. traineeCollection.item(0).firstChild.nodeValue
D. traineeCollection.item(0).firstChild.firstChild.nodeValue
Answer: A, B, D
Q3. To import rich data types support of Microsoft’s XML processor (MSXML), which namespace should you use?
A. urn:microsoft-com:data
B. urn:shemas-microsoft-com:data
C. urn:shemas-microsoft-com:datatypes
D. urn:shemas-microsoft-com:types
Answer: C [We use xmlns:dt=” urn:shemas-microsoft-com:datatypes” and then specify like <id dt:dt=”int”>101</id>]
Q4. According to XML-Data specification within datatypes namespace, what does the following data type declaration
mean?
fixed.14.4
A. A number of 4 digits with 14 parts precision
B. A number which can have maximum 14 digits but alt least 4 digits
C. A number which can have maximum 14 digits on the left of decimal point and maximum 4 digits on the right of
decimal point
D. A number which can have maximum 14 digits but maximum 4 digits on the right of decimal point
Answer: C
Q5. Which property of an element node helps to access the data type of the node?
A. nodeType
B. nodeDataType
C. dataType
D. Type
Answer: C [Another data type related property is nodeTypedValue, allows accessing the content of the node]
Q6. Find out the parts which a qualified name is composed of.
A. Namespace Name
B. Local Name
C. Universal Name
D. Resource Name
Answer: A, B
Q7. ___________ in XML is a methodology for creating unique name in an XML document by identifying element names with
a unique external resource.
Find out the correct word for the blank.
A. Document rules
B. Schema Definitions
C. Namespaces
D. Parsers
Answer: C
Q8. Which one makes an XML element or attribute name universally unique?
A. A Document rule
B. A Schema Definition
C. A Namespace
D. An XML Parser
Answer: C
Q2. Which vocabulary provides supports for building links into XML?
E. XSL
F. XPointer
G. XLink
H. XHTML
Answer: C
Q4. Which type of Link in XLink works as they same way as the HTML Links?
A. Simple Link
B. Extended Link
Answer: A
Q5. Which XML link mechanism allows linking only one resource?
A. Simple Link
B. Extended Link
Answer: A
Q6. Which of the following is or are the valid syntaxes of addressing XML link resource?
A. HREF=”uri?XPointer”
B. HREF=”uri#XPointer”
C. HREF=”uri|XPointer”
D. HREF=”uri!$XPointer”
Answer: B, C
Q7. Which attribute of an XML Link identifies the significance of the link to the application processing it?
A. TITLE
B. ROLE
C. SHOW
D. ACTUATE
Answer: B
Q8. Which attribute of an XML Link identifies how the link should be traversed?
A. TITLE
B. ROLE
C. SHOW
D. ACTUATE
Answer: C
Q9. Which attribute of an XML Link identifies how the link should be activated?
A. TITLE
B. ROLE
C. SHOW
D. ACTUATE
Answer: D
Q10. What are the permissible values of the SHOW of an XML Link element?
A. blank
B. new
C. embed
D. replace
Answer: B, C, D
Q11. If you want that the content of the target source should be inserted at the position of an XML Link in a source
document, what will be the value of the SHOW attribute?
A. blank
B. new
C. embed
D. replace
Answer: C
Q14. Which type of link allows creating links in which the local resource is not the part of the link?
A. Inline-link
B. Out-of-line link
C. Simple link
D. Extended link
Answer: B
Q15. Which one provides a way to address the internal structure of an XML document?
A. XLink
B. XPath
C. XPointer
D. XSL
Answer: C
Q16. Which one in Pointer specifies a location in in the XML document tree?
A. Location group
B. Location term
C. Address term
D. Resource term
Answer: B
Q7. XML uses __________ to specify the XML element to which an XSL template applies?
A. XML DOM
B. XPointers
C. Patterns
D. Scripts
Answer: C
Q8. For a XSL Patterns Query to work, you specify a ______ in which it will operate.
Choose the write option for the blank.
A. context
B. root
C. node
D. tree
Answer: A
Q9. Which symbol is placed in front of an attribute name in an XPath pattern expression?
A. $
B. #
C. @
D. \
Answer: C
Q12. Which of the following is or are used in XSL for conditional processing?
A. xsl:if
B. xsl:select
C. xsl:choose
D. xsl:switch
Answer: A, C
Q13. Which of the following used to direct XSL processor to find the correct template to apply based on the pattern
specified?
A. xsl:apply
B. xsl:apply-templates
C. xsl:template
D. xsl:find
Answer: B
Q15. Which XSL element is used in conjunction with xsl:choose and xsl:when?
A. xsl:else
B. xsl:otherwise
C. xsl:default
D. xsl:none
Answer: B
Q17. Which XSL element evaluates an XSL pattern and returns the value of identified node as text?
A. xsl:value
B. xsl:value-of
C. xsl:get
D. xsl:of
Answer: B
Q18. Which extension XSL is built around filtering and addressing data XML document?
A. XSL patterns
B. XSL query
C. XSL template
D. XPointer
Answer: A
Q19. “XSL patterns query specify what should be found in XML document and how to find it”
Is this statement true?
A. Yes
B. No
Answer: B [XSL patterns query specify what should be found in XML document, NOT how to find it. See page 149]
Q20. Which symbol is used to separate the address elements in XSL patterns query?
A. \
B. /
C. ?
D. !
Answer: B
Q25. Which one is short for case-insensitive less than or equal to operator in XSL patterns?
A. $le$
B. $ile$
C. $cle$
D. $gle&
Answer: B
Q3. Schema langue does not use XML syntax but DTD does .
Do you agree?
A. Yes
B. No
Answer: B [Reverse is true]
Q4. Which one must be the root element in an XML Schema document?
A. Schema
B. ElementType
C. AttributeType
D. Element
Answer: A
Q5. Which namespace you must associate with Schema element in an XML Schema document?
A. urn:microsoft-com:xml-data
B. urn:schemas-microsoft-com:xml-data
C. urn:schemas-microsoft-com:datatypes
D. http://www.w3.org/1999/XSD
Answer: B [C is used to import rich data types]
Q6. Which of the following is or are the top-level elements in an XML Schema document?
A. ElementType
B. AttributeType
C. element
D. attribute
Answer: A, B [ElementType and AttributeType are declared directly under Schema element. The element and attribute are
decalred within ElementType]
Q7. Which of the following is or are the local-level elements in an XML Schema document?
A. ElementType
B. AttributeType
C. element
D. attribute
Answer: B, C
Q8. Which one of the following is NOT the valid value of the content attribute in an XSML Schema document?
A. empty
B. any
C. textOnly
D. eltOnly
E. mixed
Answer: B
Q9. What are the possible values of order attribute of element type in XML-Data Schema Language?
A. seq
B. one
C. all
D. many
Answer: A, B, C, D
Q10. How can you specify the order in which the elements in the declaration can appear?
A. By using the type attribute in the element type declaration
B. By using the order attribute in the element type declaration
C. By using the sequence attribute in the element type declaration
D. You can not specify order
Answer: B
Q11. What does the value many of the order attribute in the element type declaration specify?
A. Elements must appear in the same order as they appear in element type declaration
B. one of the declared elements must appear in the parent element
C. All the element types declared must appear as a subelement, the subelements can appear in any order
D. Any of element types declared must appear as a subelement and in any order
Answer: D
Q13. The default value for the both minOccurs and maxOccurs is ____.
Choose the correct one?
A. 0
B. 1
C. unspecified
D. unlimited
Answer: B
Q14. How many times an element can appear if both maxOccurs and minOccurs attributes are not specified.
A. 0 time
B. 1 time
C. Any number of time
D. These attributes must specified
Answer: B
Q15. You are creating an XML Schema document, which one is correctly sets the maxOccurs attribute to specify that the
element can appear any number of times?
A. maxOccurs=”unlimited”
B. maxOccurs=”any”
C. maxOccurs=”*”
D. maxOccurs=”?”
Answer: C [Don’t confuse with XSD, XSD uses unlimited]
Q16. How can you specify that the value for an attribute must be give?
A. By adding the optional attribute in attribute declaration and specifying its value no
B. By adding the required attribute in attribute declaration and specifying its value yes
C. By adding the optional attribute in attribute declaration and specifying its value false
D. By adding the required attribute in attribute declaration and specifying its value true
Answer: B
Q2. Which of the following can be used to insert into XML data into HTML document without creating an ActiveX Control?
Which one the best option for the blank?
A. XML DSO
B. XML Data Islands
C. XML-Data Schema Language
D. DTD
Answer: B
Q3. Which of the following is are the advantages of XML Data Islands over XML DSO?
A. You do not need a separate XML file
B. You do not need to load XML using scripting code
C. You do not need to create active control using object tag
D. XML data is independent of HTML page
Answer: A, B, C [D is not true for XML Data Islands. XML Data Islands make your XML data and HTML page more tightly
coupled. It is a disadvantage]
Q4. Which of the following is or are the valid attribute of XML element used for XML Data Islands
A. SRC
B. ASYNC
C. DATASRC
D. VAIDATEONPARSE
Answer: A, B, D
Q5. Which one is XML based technology for displaying TV-like multimedia over Internet?
A. SVG
B. SMIL
C. HTML+TIME
D. Flash
Answer: B [Flash can show animations but it is not XML based]
Q6. Which XML-based technology enables you to times effects on your web page?
A. SVG
B. SMIL
C. HTML+TIME
D. Flash
Answer: C
Q11. Which of the following feature or feature for each object DOM provides?
A. the interfaces used to manipulate the object
B. the meaning of the object in relationship to the rest of the document
C. the collaboration between interfaces and objects
D. the naming rules to define object in a document
Answer: A, B, C
Q4. Which one is the standard API for an application to communicate with a steam-based parser?
A. Document Object Model (DOM)
B. Simple API for XML (SAX)
C. XML Link Language (XLL)
D. XML Data Islands
Answer: B
Q5. Which one is the standard API for an application to communicate with a tree-based parser?
A. Document Object Model (DOM)
B. Simple API for XML (SAX)
C. XML Link Language (XLL)
D. XML Data Islands
Answer: A
Q8. Which implementation should you choose for parsing a huge XML document?
A. SAX
B. DOM
Answer: A
Q3. Which Database Management System allows storing and retrieving objects in addition to mere data?
A. Hierarchical Database Management System
B. Relational Database Management System
C. Object-Oriented Database Management System
D. XML Database Management System
Answer: C
Q5. Which type of XML Documents is designed for application-to-application data exchange?
A. Data-Centric
B. Document-centric
Answer: A
Q6. Which type of XML Documents generally contains a lot of mixed contents?
A. Data-Centric
B. Document-centric
Answer: B
Q7. Which one supports richer set of data types than the other one?
A. DTD
B. XSD
Answer: B
Q8. Which of the following is or are the ways of encoding binary data in XML?
A. Parsed Entities
B. Unparsed Entities
C. ASCII
D. Base64
Answer: B, D
Q9. Which of the following XSD element or elements can be used to create primary key constrains?
A. xsd:key
B. xsd:unique
C. xsd:keyref
D. xsd:primarykey
Answer: B [xsd:key is same as xsd:unique but allows null values]
Q10. Which of the following XSD element or elements can be used to create foreign key constrains?
A. xsd:key
B. xsd:unique
C. xsd:keyref
D. xsd:foreign
Answer: C
Q11. Which of the following XSD elements are used only in conjunction with xsd:key, xsd:unique or xsd;keyref?
A. xsd:selector
B. xsl:path
C. xsd:field
D. xsd:element
Answer: A, C