Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Carey Brown
  • Frits Walraven

clarification for mock test Shashanks

Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain the answers for these IBM Mock questions.

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)
Is the parser at the receiving end a validating parser?

Does the parser handle XML Schemas or DTDs?

Is the parser validation lenient?

Does the document instance override the internal DTD subset?

Is the same parser being used at both ends?

Please explain the logic to arrive at this answer . ?

Answer : a b d

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

How is empty identifed in a schema ?
Answers: d

21. Which of the following Document type definitions will validate the below XML document successfully ?
<? xml version="1.0" ?>
(Select 3 correct choices)

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

Answers: b c 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">
b) <?xml version="1.0"?>
<root attr1="1value" attr2="2value">
c) <?xml version="1.0"?>
<root attr1="1value" attr2="">
<root> 5 is < than 4 </root>
d) <?xml version="1.0"?>
<root attr1="1value" attr2="">
<root> 5 is > than 4 </root>

Answer: a c

Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dhiren

5. a b d
a is right as the requirement explicitly states "XML messages conforming to a single vocabulary". So I think the parser must be must be a validating parser to make sure document is validated properly.
b is opted maybe because if the recieving parser though is a validating parser and does not handle shcemas then this developer has to stick in accordance with receiving parser qualities like supports or does not support Schemas or DTD's.
I am not sure of d, maybe somone can help here. But the other two options c, e in my opinion however are not correct. I am not sure if parer can be lenient? And it does not matter whether parsers are same at both end or not as long as they both are validating parsers.

14. How is empty identifed in a schema ?
This is the example given in Pro. XML 2nd edition for an empty element using schema

I changed some code..but this is how to specify an empty element using schema. From Pro. XML "In order to define an empty element in XML schema we first have to define a complex type, and then have to restrict if from the anyType so that it can only carry attributes."

21. b c d
a is not correct as #IMPLIED does not take a default "value". For #FIXED only you should specify an attribute. e is not correct as content model to define elements allows either child elements or #PCDATA. b is correct as it defines an empty elment with fixed attribute value. Attribute is optional and hence b is correct. c is correct as it says element can contain #PCDATA which is any text including empty. d is correct as content category says ANY and attribute has already provided a default value.

40. a c
a is not well formed as the tags are not properly closed/nested. c is wrong as it contains < symbol which is not allowed in CDATA section(Here root is CDATA and so < is not allowed and if it must appear it must use entity reference). b is well formed and d is also well formed as > is allowed in CDATA section.

Dhiren, I tried to answer. I am not sure if I am right.

Guys, please correct me if I'm wrong.

Dhiren Joshi
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks again Satish for all the explainations.

Still not clear about the first (5) how the answer is coming out to be "d" .

Anyone ...

Onion rings are vegetable donuts. Taste this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
    Bookmark Topic Watch Topic
  • New Topic