• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

mock exam question

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


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) >
Answer : B,C,D


Why A is not correct while C is?
 
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jim,
XML bible says the following about the #IMPLIED option -
"sometimes you donot have a good option for the default value and you don't even ""require"" the author of the document to include a value"
This is why A is incorrect.
I don't find anything wrong with option C. The attribute is not at all mentioned for the root element in the DTD and doesn't exist in the instance document.
 
jim yin
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jayadev Pulaparty:
Jim,
XML bible says the following about the #IMPLIED option -
"sometimes you donot have a good option for the default value and you don't even ""require"" the author of the document to include a value"
This is why A is incorrect.
I don't find anything wrong with option C. The attribute is not at all mentioned for the root element in the DTD and doesn't exist in the instance document.


I see. I just got confused, there should not be any value after #IMPLIED. Thanks.
 
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic