• 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

mock exam question

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
I'm doing laundry! Look how clean this tiny ad is:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic