Shashank Tanksali's IBM XML (141) Mock Exam |
1. Which of the following nodes in a DOM tree are always leaf nodes (nodes with no children)?
(Select 3 correct choices) |
|
|
|
|
2. Which of the following statements MOST accurately describes a "linkbase" ? |
|
a)A linkbase is an XML document which contains links to other resources,
which may or may not be XML documents
b)An XML document, which contains inbound or third party links is called a linkbase
c)A linkbase is a series of extended links which link to each other
either directly or indirectly.
d)A database of links maintained in an XML document is a linkbase.
|
|
|
3. During the redesign of a legacy system, it is decided to use XML as the data exchange format between
different processes. It is proposed to generate XML data from the database and send it to any process
that might have a need for it. Also the same XML document will contain the data for different database tables,
all of which have different keys. Which of the following DTD or Schema constructs is MOST likely to be used
in the system ? |
|
a)ID/IDREF
b)xsl:key
c)unique
d)key/keyref
e)generate-id()
|
|
Answer : d
Allows the key to be defined for a group of elements rather than whole document.
|
4. Which of the following represents an abstraction of an unordered collection of nodes in DOM? |
|
a)NodeList
b)DocumentFragment
c)NamedNodeMap
d)Attributes
|
|
|
5. In a B2B organization, it is required to exchange XML messages conforming to a single vocabulary
with other companies in real time. The messages arrive via different media including email. Since the messaging
is done over the internet,it is important that the messages be validated at both ends when they arrive.
What factors are likely to be considered by a developer, when designing such a system.
(Select 3 correct choices) |
|
|
|
|
6. Which of the following DOM interfaces could be used to filter a set of nodes from a tree based on some criteria? |
|
a)TreeFilter
b)NodeFilter
c)TreeWalker
d)NodeIterator
|
|
|
7. Which of the following statements does not correctly identify the limitations of DTDs ? |
|
a)Only one DTD may be associated with any XML document
b)DTDs do not support namespaces
c)DTD can be changed programatically using the DocumentType interface in DOM
d)DTDs are not extensible
e)DTDs support very weak data typing
|
|
|
8. <xsd:element name="myElement" />
Assuming that the xsd prefix is mapped to the namespace URI for XML schema, what is the type
of the element with name "myElement" ? |
|
a)ANY
b)xsd:anyType
c)EMPTY
d)It is illegal to define an element without specifying a corresponding type
|
|
|
9. Which of the following are valid combinations of minOccurs and maxOccurs for any element in a xsd:all group
?
(Select 2 correct choices) |
|
a) minOccurs = 1 maxOccurs = 1
b) minOccurs = 0 maxOccurs = unbounded
c) minOccurs = 0 maxOccurs = 0
d) minOccurs = 0 maxOccurs = 1
|
|
|
10 Which of the following XSLT functions can be used to return a nodeset with the current context node? |
|
a)context()
b)node()
c)current()
d)self()
|
|
|
11. What schema groups should a group of elements be defined under in order to allow them all to appear
in any sequence in a document instance? |
|
a)xsd:all
b)xsd:any
c)xsd:choice
d)xsd:sequence
|
|
|
12. XSL is BEST described as a |
|
a) Object-oriented programming language
b) Procedural programming language
c) Declarative language
d) Interpreted language
|
|
|
13. Which of the following resources can be signed using an XML signature?
(Select 3 correct choices) |
|
a)XML encoded data
b)specific section of an XML file
c)Binary encoded data
d)Set of nodes returned as a DocumentFragment
|
|
|
14.Which of the following schema fragments is the same as the DTD fragment below ?
<!ELEMENT myElement EMPTY> |
|
a)<xsd:element name="myElement"/>
b)<xsd:element name="myElement" type ="xsd:anyType"/>
c)<xsd:element name="myElement" type="xsd:empty"/>
d)None of the above
|
|
|
15. Which of the following cannot be a part of a SOAP message?
(Select 2 correct choices) |
|
a)User defined elements, which belong to an application namespace
b)DTD
c)Processing Instruction
d)Status information pertaining to a SOAP response
|
|
|
16. <myNS:myElement xmlns:myNS= "http://www.myhost.com/myNS"/>
The above line is parsed using a SAX2 parser.
What is the sequence of events passed by the parser to the handler ? |
|
a)startElement(), startPrefixMapping(), endElement(), endPrefixMapping()
b)startPrefixMapping(),startElement(),endElement(),endPrefixMapping()
c)startMapping, endMapping,startElement(), endElement()
d)None of the above
|
|
|
17. Consider the below XML document
<? xml version="1.0" ?>
<root xml:space="preserve">
</root>
A DTD is written for the above XML document such that the above XML document is validated successfully
against the DTD. Which of the following statements about the DTD are true? |
|
a)The DTD needs to declare xml:space as an attribute of the root element
b)The xml:space need not be declared as an attribute of root element
c)The XML document cannot be validated successfully, since the prefix xml is
reserved and cannot be used in instance documents
d)A DTD for the above document can be written but the root element must be declared
as EMPTY
|
|
|
18. Which of the following XML Schema elements can be used to make schemas more readable ?
(Select 2 correct choices) |
|
a)xsd:annotation
b)xsd:comment
c)xsd:title
d)xsd:appInfo
|
|
|
19. Which of the following value pairs for the parameters minOccurs and maxOccurs can be used to indicate
the cardinality operator "?" |
|
a)minOccurs = "1" maxOccurs = "unbounded"
b)minOccurs = "0" maxOccurs = "1"
c)minOccurs = "0" maxOccurs = "unbounded"
d)minOccurs = "1" maxOccurs = "1"
|
|
|
20. Which of the following statements about XSL formatting objects are false ? |
|
a)Formatting objects describes the layout of a series of nested boxes or areas
that are placed on atleast one page
b)Elements in XSL-FO objects map to the boxes on the page in a one to one fashion
c)XSL-FO allows multi-column layouts and footnotes etc in page margins.
d)XSL-FO allows conditional formatting.
|
|
|
21. Which of the following Document type definitions will validate the below XML document successfully ?
<? xml version="1.0" ?>
<root/>
(Select 3 correct choices) |
|
|
|
|
22. Which of the following statements about namespaces and DTDs are false? |
|
a)A document can have a DTD but not use namespaces or use namespaces
but not have a DTD
b)A document can use both namespaces and DTDs or neither namespaces nor DTDs
c)Namespaces are completely independent of DTDs
d)DTDs for a document with namespace qualified elements cannot be written
since DTDs do not support namespaces
|
|
Answer: d
DTDs support namespaces in a limited way. It is not possible to change
the prefix and keep the same namespace URI
|
23. Which of the following XML documents will NOT get successfully validated against the DTD below
<!ELEMENT root (root1,root2?,root3*)*>
<!ELEMENT root1 (#PCDATA)>
<!ELEMENT root2 (#PCDATA)>
<!ELEMENT root3 (#PCDATA)> |
|
|
|
|
24. which of the following SAX2 methods is used by a non validating parser to report that an entity reference
is not resolved |
|
a)skippedEntityReference()
b)ignorableWhitespace()
c)skippedEntity()
d)ignorableEntity()
|
|
|
25. Which of the following XSLT functions returns the number of nodes present in the nodeset, passed
as an argument |
|
a)last()
b)sum()
c)count()
d)size()
|
|
|
26. Which of the following XML based technologies can be considered as XML metadata?
(Select 2 correct choices) |
|
a)Document Type Definition
b)eXtensible Stylesheet language
c)Document Object Model
d)XML Schema
|
|
|
27. Nebula communications Inc is currently in the process of optimizing their database driven XML based web
application. This application reads records from a database, constructs a DOM tree in memory and generates
real time reports for display to end users.
Due to an increase in the number of records in the database and limited memory resources, the process
of generating reports is very slow. A developer has been assigned the task of looking at ways to improve
the performance of the web based application without affecting the functionality.
Which of the following changes to the XML based web application is MOST likely to be considered
by a developer, who is looking at ways to minimize the XML based applications report generation time ? |
|
a)Change the application's parser to SAX instead of DOM
b)Transmit the XML document directly and perform the processing of the XML document
in the web browser
c)Modify the application to generate the reports as HTML documents
at regular intervals and serve the HTML documents to the browser
d)Use attributes instead of elements to reduce XML document size
|
|
|
28. A small retailer maintains inventory data in an XML document. This inventory data is read by an application.
The application allows new inventory items to be added to the XML based database. The application also allow
update of inventory details in the XML based database.
Which of the following XML technologies is MOST likely to be used by the application ? |
|
a)XQuery
b)SAX Parser
c)XSLT processor
d)DOM Parser
e)XML schema validator
|
|
|
29.Which of the following statements regarding WSDL are true ?
(Select 2 correct choices) |
|
a)WSDL acts as a Universal registry where a business entity providing a service
can be registered
b)WSDL can be used to indicate the operations that are considered valid
and supported for a given service
c)To specify how a particular service is implemented
d)To specify where a particular service is implemented
|
|
|
30. An XML based application maintains a very large configuration file in XML format.
The application needs to read the configuration file at startup and at intermittent intervals for updates.
The process of reading the configuration file needs to be very fast, so as not to impact other parts of the system.
These requirements can be MOST easily accomplished by designing the configuration loader based on
which of the following? |
|
a)An XSLT processor based on DOM
b)DTD
c)XML Schema
d)DOM
e)SAX
|
|
|
31. Which of the following entries in an XML document will cause an application reading the document
to use null values for the field named "customerAddress"? |
|
a)<customerAddress xsd:null="true"/>
b)<customerAddress/>
c)<customerAddress xsd:nill="true"/>
d)<customerAddress xsd:nill="null"/>
e)The nonexistence of the element in the XML document will cause
the application to use a null value.
|
|
|
32. A valid SOAP message should contain which of the following XML elements ?
(Assume that all the elements are prefixed appropriately with the correct namespace URI) |
|
a)Envelope, Header, Body
b)Envelope, Header
c)Body, Header
d)Envelope, Body
e)Envelope
|
|
|
33. Which of the following values of minOccurs and maxOccurs respectively represent the cardinality
operator "+" ? |
|
a)0, 1
b)1, unbounded
c)unbounded, 1
d)0, unbounded
e)unbounded, 0
|
|
|
34. Which of the following statements correctly describe the differences between key/keyref and ID/IDREF ?
(Select 2 correct choices) |
|
|
|
|
35. Which of the following unabbreviated XPath expressions is the same as the abbreviated
XPath expression below?
/book/chapter[4]/paragraph[2]/sentence[1] |
|
a)/child::book/child::chapter[position()=4]/child::paragraph[position()=2]/child::sentence[position()=1]
b)/descendant::book/child::chapter[4]/child::paragraph[2]/child::sentence[1]
c)/descendant-or-self::book/child::chapter[4]/child::paragraph[2]/child::sentence[1]
d)None of the above
|
|
|
36. Which of the following statements about XML signatures are true ?
(Select 2 correct choices) |
|
|
|
|
37. A University wants to unify all their applications from the various departments in order
to have a centralized view of the entire system. It is proposed to use XML as the data interchange
format for transmitting data between the various departments. In addition, various departments
in the University use different terminologies to refer to the same data.
Which of the following approaches is MOST likely to be used to integrate the various University departments ? |
|
a)Devise a common information model and enforce it's use by all the departments
which need to exchange data
b)Implement a conversion application that can handle the data received
from any other department
c)Use an XSLT stylesheet to convert the incoming or outgoing XML document
into the format used within the division
d)Modify the DTD/XML Schema to use the same content model in both divisions
e)Devise a method where a department transmitting data also sends
the interpretation of the data to the receiving department
|
|
|
38. Which of the following statements regarding the differences between DOM and SAX are false ?
(Select 2 correct choices) |
|
a)DOM is ideally suited than SAX for handling large documents, that may need
to be searched efficiently
b)Parsing of an XML document can be aborted when the elements of interest
are found when using SAX
c)SAX is a read-only XML parsing methodology
d)If random access to an XML document is desired, SAX is better suited than DOM
|
|
|
39. Which of the following statements w.r.t XLinks and HTML links are true ?
(Select 2 correct choices) |
|
a)XLinks only connect two resources
b)HTML links cannot be used for multi directional navigation
c)XLinks can only be used to link well formed XML documents
d)XLinks can be used to link documents without modifying the documents
to include the links
|
|
|
40. Which of the following XML documents are NOT well formed ?
(Select 2 correct choices) |
|
|
|
|
41. Which of the following axes can be used together to reference all the nodes in any XML document ? |
|
a)ancestor-or-self,descendant-or-self,self
b)ancestor, descendant, self, child
c)ancestor, descendant, self, following, preceding
d)ancestor, following-sibling, preceding-sibling, descendant
e)It is not possible to reference all the nodes using unabbreviated
XPath expressions
|
|
|
42. An XML based web application to process audio files which are binary in nature needs to be written.
The application receives data in the form of audio files from various users over the internet. The web based
application also allows the dynamic search and discovery of audio files on other member's systems
and other web sites hosting audio files. The search and discovery of audio files are dynamic in nature
and change frequently.
Which of the following is MOST likely to be used in the development of the XML based web application ? |
|
a)SOAP
b)UDDI
c)WSDL
d)XML Schema
e)None of the above
|
|
|
43. Which of the following statements about XSL formatting objects are true ?
(Select 3 correct choices) |
|
|
|
|
44. Which of the following statements regarding processing instructions are true ?
(Select two correct choices) |
|
|
|
|
45. Which of the following statements regarding messaging with SOAP are true? |
|
a)SOAP messages can be sent only using HTTP, HTTPS or FTP
b)SOAP is a protocol agnostic methodology of transmitting data
to other SOAP enabled applications
c)Legacy applications which use protocols like HTTP and FTP
can be replaced to use SOAP seamlessly
d)SOAP stands for Serialized Object Access Protocol
|
|
|
46. Which of the following XML documents is NOT well formed ?
(Select 3 correct choices) |
|
|
|
|
47. Which of the following lines can be used in an XML document named Test.xml
to associate it with a stylesheet named Test.css |
|
a)<?xml-stylesheet href="Test.css" type="text/css"?>
b)<?xml-stylesheet href="Test.xsl" type="text/css"?>
c)<?xmlstylesheet href="Test.css" type="text/xsl"?>
d)<xml-stylesheet href="Test.css" type="text/css"/>
e)<?xml-stylesheet link="Test.css" type="text/css"?>
|
|
|
48. A county library uses an XML based application to query an XML database of books maintained
in the library. Any visitors to the library are allowed to perform a search on the database to ascertain
if a book of interest is available in the library. Due to an increase in the number of books and the number
of searches conducted in the library, it is proposed to optimize the XML based application, so that it returns
only the first 10 results if the number of matches exceeds 10. Which of the following XML based technologies
is MOST likely to be considered for making the change ? |
|
a)DOM
b)XSL
c)SAX
d)XML Schema
e)DTD
|
|
Answer: c
SAX allows the abortion of processing of an XML document after
10 elements have been found, thereby enhancing performance. Besides,
SAX is a preferred way for handling large documents.
|
49. UDDI stands for which of the following. |
|
a)Universal Description Discovery and Integration
b)Universal Data Discovery and Integration
c)Universal Dynamic Discovery and Integration
d)None of the above
|
|
|
50. Which of the following XSLT functions can be used to generate a string that can be used as the value
of an ID type attribute? |
|
a)generate-key()
b)generate-id()
c)key()
d)id()
e)None of the above
|
|
|
51. Which of the following values correctly represent the default values of the minOccurs and maxOccurs
attributes respectively ? |
|
a)0,0
b)1,1
c)1,unbounded
d)unbounded,unbounded
e)0,unbounded
|
|
|
52. Which of the following statements regarding XLinks are FALSE? |
|
a)XLinks need not be embedded in the document being linked
b)XLinks can be used to connect only two resources
c)XLinks allow navigation in more than one direction
d)XLinks can be used to specify the behaviour of the rendering engine
e)None of the above
|
|
|
53. Which of the following abbreviated XPath expressions is equivalent to the following unabbreviated
XPath expression ?
child::chapter[attribute::number and attribute::title] |
|
a)chapter[@number and @title]
b)chapter[@number && @title]
c)chapter[@number][@title]
d)chapter[@number & @title]
e)None of the above
|
|
|
54. Consider the following XML document and the attached stylesheet. What is the result of applying
the stylesheet Test.xsl to the document Test.xml
Test.xml:
<?xml-stylesheet href="./Test.xsl" type="text/xml"?>
<Root attr1="val1">
<Child attr1="val1"></Child>
</Root>
Test.xsl:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="Root">
<xsl:if test="Root/Child/@attr1 = 'val1'"> TRUE </xsl:if>
FALSE
</xsl:template>
</xsl:stylesheet> |
|
a)TRUE
b)TRUEFALSE
c)FALSE
d)Applying the stylesheet to the XML document results in an error
|
|
|
55. Which of the following XML Schema element definitions are equivalent to the element definition below ?
<xsd:element name="myElement" type="xsd:anyType" /> |
|
a)<xsd:element name=myElement />
b)<xsd:element name="myElement" type="xsd:string" />
c)<xsd:element name="myElement" type="ANY" />
d)<xsd:element name="myElement" />
e)None of the above
|
|
|
56. Which of the following XPath function calls will return the value 10 when invoked ? |
|
a)string-length("XML-Schema")
b)length("XML-Schema")
c)size("XML-Schema")
d)string("XML-Schema").size()
e)count("XML-Schema")
|
|
|
57. Which of the following statements relating to cascading style sheets and formatting objects is FALSE ?
(Select 2 correct choices) |
|
|
|
|
|
Your
scores:
|