Shashank Tanksali's IBM XML (141) Mock Exam

Answers to IBM 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)

A> Document

B> Processing Instruction

C> Notation

D> EntityReference

E> CDATASection

B C E

 

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.

B

 

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()

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

C

 

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)

A> Is the parser at the receiving end a validating parser ?

B> Does the parser handle XML Schemas or DTDs ?

C> Is the parser validation lenient ?

D> Does the document instance override the internal DTD subset ?

E> Is the same parser being used at both ends ?

A B D

 

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

B

 

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.

C

 

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

B

 

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

A D

 

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 ()

C

 

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

A

 

12> XSL is BEST described as a

A> Object oriented programming language

B> Procedural programming language

C> Declarative language

D> Interpreted language

C

 

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

A B C

 

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

D

 

15> Which of the following cannot be a part of a SOAP message ?

A> User defined elements, which belong to an application namespace

B> DTD

C> Processing Instruction

D> Status information pertaining to a SOAP response.

B C

 

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

B

 

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.

A

 

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

A D

 

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"

B

 

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 XSLFO 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.

B

 

21> Which of the following Document type definitions will validate the below XML document successfully ?

(Select 3 correct choices)

<? xml version="1.0" ?>
<root/>

A>
<!ELEMENT root (#PCDATA)>
<!ATTLIST root rootattr CDATA #IMPLIED "value">

B>
<!ELEMENT root EMPTY>
<!ATTLIST root rootattr CDATA #FIXED "value">

C>
<!ELEMENT root (#PCDATA)>

D>
<!ELEMENT root ANY>
<!ATTLIST root rootattr CDATA "value">

E>
<!ELEMENT root (CDATA) >

B C D

 

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.

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)>

A>
<root>
<root1/>
<root2/>
</root>

B>
<root>
<root1> root1 data </root1>
<root1> root1 data </root1>
</root>

C> <root/>

D>
<root>
<root1/>
<root3/>
<root3/>
<root2/>
</root>

D

 

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()

C

 

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()

C

 

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

A D

 

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.

A

 

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 allows updation 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

D

 

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.

B D

 

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

E

 

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 non existence of the element in the XML document will cause the application to use a null value.

C

 

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

D

 

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

B

 

34> Which of the following statements correctly describe the differences between key/keyref and ID/IDREF ?

(Select 2 correct choices)

A> Both ID/IDREF and key/keyref are used for the same purpose and can be used interchangably at all times.

B> key/keyref allows the key to be defined for a set of elements while ID/IDREF allows keys to be defined only for the entire document.

C> key/keyref have no differences. key/keyref is used with XML schema, while ID/IDREF is used with DTDs.

D> key/keyref can be used with elements and attributes, while ID/IDREF can only be used with attributes.

B D

 

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.

A

 

36> Which of the following statements about XML signatures are true ?

(Select 2 correct choices)

A> XML signatures have support for non-repudiation of the data that they sign.

B> XML signatures can be used for XML data authentication.

C> Application of an XML signature to certain portions of an XML document
guarantees that the entire XML document signed has not been modified in transit.

D> XML signatures work only with character encoded data and cannot be used to
sign binary encoded data like images.

A B

 

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.

C

 

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.

A D

 

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.

B D

 

40> Which of the following XML documents are NOT well formed ?

(Select 2 correct choices)

A>
<?xml version="1.0"?>
<root attr1="val1" attr2="" attr1="test">
<root/>
</root>
</root>

B>
<?xml version="1.0"?>
<root attr1="1value" attr2="2value">
<root/>
</root>

C>
<?xml version="1.0"?>
<root attr1="1value" attr2="">
<root> 5 is < than 4 </root>
</root>

D> <?xml version="1.0"?>
<root attr1="1value" attr2="">
<root> 5 is > than 4 </root>
</root>

A C

 

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.

C

 

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.

B

 

43> Which of the following statements about XSL formatting objects are true ?

(Select 3 correct choices)

A> It is possible to perform conditional formatting using XSL FO.

B> Elements in an XSL FO document describe the elements on a rendered page in a one to one fashion.

C> It is possible to render a page with multi column layouts using XSL FO.

D> Formatting objects can be used to describe the layout of a rendered page.

E> None of the above

A C D

 

44> Which of the following statements regarding processing instructions are true ?

A> Processing instructions are used to provide information to an XML Parser about the data being parsed.

B> Processing instructions can be used as a mechanism for extending schemas that cannot otherwise be modified.

C> The target for a processing instruction must be a valid XML name.

D> Atleast one processing instruction should be part of every XML document.

B C

 

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.

B

 

46> Which of the following XML documents is NOT well formed ?

(Select 3 correct choices)

A>
<?xml version="1.0"?>
<!-- This is a comment -->
<root attr1="val1">
</root>

B>
<?xml version="1.0"?>
<root attr1="val1" attr2="<!-- This is a comment -->">
</root>

C>
<?xml version="1.0"?>
<root attr1="val1" attr1="">
<!-- This is a comment -->
</root>

D>
<?xml version="1.0"?>
<root attr1="val1" attr2="">
</root>
<!-- --- This is a comment ---- -->

E>
<?xml version="1.0"?>
<root attr1="val1" attr2="">
</root>
<!-- This is a comment -->

B C D

 

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"?>

A

 

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

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

A

 

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

B

 

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

B

 

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

B

 

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

A

 

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.

C

 

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

D

 

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")

A

 

57> Which of the following statements relating to cascading style sheets and formatting objects is FALSE ?

(Select 2 correct choices)

A> CSS is an XML syntax that can be used to describe the appearance of particular elements in an XML document.

B> Cascading style sheets can only be applied to non XML documents.

C> fo:root is always the root element of a formatting objects document, assuming fo is mapped to the appropriate URI.

D> It is possible to perform conditional formatting using XSL-FO, but not using CSS.

A B

 


Back to Questions


Questions compiled by Shashank Tanksali , SCJP2,SCJD2,SCWCD,IBM-XML,PMP

Send comments and feedback about this mock exam

Good luck with your IBM XML certification !!!