• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why the answer is c),not a)

 
davidedai dai
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
Could any one explain the answer is c),not a)
Thanks
David
20. Consider the following example:
<xsd:element name="Price">
<xsd:complexType>
<xsd:attribute name="currency" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
The "currency" attribute declaration is equivalent to which of the following DTD declarations?
Single Select - Please select the best answer (one and only one choice must be selected).
a) <!ATTLIST Price currency CDATA #REQUIRED>
No, no use="required"
b) <!ATTLIST Price currency CDATA #FIXED>
No, must provide value if fixed
c) <!ATTLIST Price currency CDATA #IMPLIED>
Sounds logical for the Schema example
d) <!ATTLIST Price currency PCDATA #IMPLIED>
No need for parsed data
 
anandkrisnan variar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in the schema nothing is mentioned so its implied and required or fixed....
and so the answer (a) is wrong...
now out (c) and (d) because its an attribute it has to be CDATA and not PCDATA.
 
Karthik Jayaraman
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For ans a to be right the schema should have been
<xsd:attribute name="currency" type="xsd:string" use="required"/>
 
Naichen Liu
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The default value of attribute "use" of element "xsd:attribute" is "optional", so c is the correct answer.
Naichen
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic