000-142 Free Dumps Study Materials
Question 9: Analyze the following XML and DTD fragments that implement ID, IDREF and IDREFS used to link
manager and subordinate relationships. Where is the error in the implementation of this logic?
employees.dtd:
<!ATTLIST employee empid ID #REQUIRED>
<!ATTLIST employee mgrid ID #IMPLIED>
<!ATTLIST employee mgr IDREF #IMPLIED>
<!ATTLIST employee subs IDREFS #IMPLIED>
employees.xml:
<employees>
<employee empid="e1" mgrid="m1" subs="e2"><name>Bob Smith</name></employee>
<employee empid="e2" mgrid="m2" mgr="m1" subs="e3 e4"><name>Carol
Jones</name></employee>
<employee empid="e3" mgr="m2"><name>Keith Martin</name></employee>
<employee empid="e4" mgr="m2"><name>Monica Williams</name></employee>
</employees>
A. The subs IDREFS is formatted improperly for the second employee record.
B. The mgrid must be defined as "#REQUIRED" in the DTD.
C. The empid and mgrid attributes conflict as an element may only have a single ID attribute.
D. First two records are invalid as each employee record may have either empid or mgrid attribute, but not
both.
Correct Answer: C