• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

MOCK QUESTIONS !!

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

Could anyone plz help me with these questions?
I found that from various mock exams.

1.How many Itemname elts will be outputed when this style sheet is applied?
The instant doc. :

The output is 5.But I would say it's 3 is there anyone to explain how 5 is correct?
2.How many elts will be outputed when this style sheet is applied?
The instant Doc.

The output is 7.
Plz explain that. Iam not sure how it is!

3. whether comments can be nested or not?

<!-- Iam fine so far "[ <!-- But not now -->] " oops -->
wellformed or not?
4. In "Redefine" if the invoking schema overrides the imported one then
the new definition get replaced or reflected everywhere (ie. old one get replaced)

My question is:

Shall we override the element which is set to "restriction|extension|all" using redefine?
Is it possible?

5.How binary data can be added to XML documents ?
6. here is the MYDTD.DTD : ( whizlabs)

The Answer is " YES"

I said "NO"
Why : First of all the root node should be the Doctype elt ? here it's "x".
Do anyone explain me how this is a valid document ?
Thanks
Shakthy






[/CODE]
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Answer for Question 1

In this key returns all the matching nodes but only the first node is selected.
If the first node returned from key() is the current node then count is 1.
For e.g.

The above node is first in the returned values
so count(.|itself) is 1.
But for this node

The first node selected through key is from supplier "vinay".
So the count becomes 2 (current node + the first occurance) that's why this node is skipped.

This node is also skipped for the same reason.
2 nodes are skipped so the answer is 5(totally there are 7 nodes)
[ December 24, 2002: Message edited by: Gobiraj Vadivelrajan ]
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
2) Please look at -
https://coderanch.com/t/125230/XML/Xpath
3) Comments can't be nested. Even -- is not allowed inside a comment.
5) Please read at -
http://www.ibiblio.org/xml/books/bible2/chapters/ch24.html and search for 'Binary types'.
Cheers,
Dan
 
Jaysakthy Muthuvelu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Guys,
What abt question : 4 & 6.
Sorry 2 more questions :
1.If multiple declaration has been declared for the same elt. then which one get selected.As per mock exam "last" one get declared bcoz non-validating parsers do like that.
Is this correct?
2. What if there is 2 attlist ?
then i think second declaration get merged with the first one.Am i correct or not?
Is there any special cases in this?
3.Might be simple :
"Number("99 abcd")" what is the o/p?
True or false ?

Thanks,
Shakthy.
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Shakthy,
6) It's a valid document.
You said -

the root node should be the Doctype elt.


It's x - The DTD syntax doesn’t have a special construct which says that a particular element is the root element and the order of the element definitions in the DTD can be totally arbitrary.
x is defined as -
<!ELEMENT x Any>
and the content model which x actually uses is (y,test).
Cheers,
Dan
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
4) Based on -
http://www.brics.dk/~amoeller/XML/schemas/xmlschema-inclusion.html
redefine is equivalent to include and in addition allows to redefine/override locally any element.
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
2b) The case of multiple element declarations is very straight forward - it's not allowed.
It gets more interesting with multiple declarations for entities and attributes. In these cases the first declaration is binding.
Please look at -
https://coderanch.com/t/146681/po/certification/Internal-DTD-External-DTD
 
reply
    Bookmark Topic Watch Topic
  • New Topic