Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Questions clarification

 
Dhiren Joshi
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got these question from a web site they r mock questions ..

1.Which of the following would raise an error if the empID attribute's data type was defined as type ID in the DTD?


a.<name empID="17563">Joe Smith</name>
b.<name empID="ft:17563">Joe Smith</name>
c.<name empID="a17563">Joe Smith</name>
d. <name empID="">Joe Smith</name>



29. Wherever a pants element is allowed in an XML Schema, the XML Schema should also allow a jeans or a shorts element. Which of the following satisfies this requirement?


a.<xs:element name = "pants" type = "pantDetails" />
<xs:element name = "jeans" type = "pantDetails" substitutionGroup = "pants" />
<xs:element name = "shorts" type = "pantDetails" substitutionGroup = "pants" />

b.<xs:element name = "pants" type = "pantDetails" abstract="true" />
<xs:element name = "jeans" type = "pantDetails" substitutionGroup = "pants" />
<xs:element name = "shorts" type = "pantDetails" substitutionGroup = "pants" />

c.<xs:element name = "pants" type = "pantDetails" />
<xs:element name = "jeans" type = "pantDetails" />
<xs:element name = "shorts" type = "pantDetails" />

d.<xs:element name = "pants" type = "pantDetails" abstract="true" />
<xs:element name = "jeans" substitutionGroup = "pants" />
<xs:element name = "shorts" substitutionGroup = "pants" />

Single Select - Please select the best answer (one and only one choice must be selected).



17. A developer needs to convert records from a relational database into XML. Each row in a table is represented as an element in the document How can the developer represent relationships in the database?


a.Use ID and IDREF attributes to represent unidirectional relationships.
b.Use ID and IDREF attributes to represent bi-directional relationships.
c.Copy the data in a relationship into the element for the row containing the foreign key.
d.Copy the data in a relationship into the element for the row containing the primary key.

Multiple Select - Please select all of the correct answers (this question has 2 correct choices).

Please explain answers selected.
What is the anwsers and why .. ?

Thanks
Dhiren
 
Vidya Ravi
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Regarding Question 1 :

The answer would be "A and D". Recall that ID should be unique in an XML document and should conform to the rules of XML names. since XML naming convention mandates that starting character should be a unicode, colon or underscore, choices A and D are incorrect.
Alternative B looks tempting with the ":" but, it is valid.

Regarding Q 17:

The answer is "A and D". ID and IDREFS allow you to express both one-to-one as well as one-to-many relationships.

I need to look closely at Q29.

Please revert if you need additional clarification.

Thanks,
Vidya
[ June 16, 2004: Message edited by: Vidya Ravi ]
 
Dhiren Joshi
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Vidya for the explainations
Dhiren
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic