• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DD/TLD elements with boolean types

 
Umakanth Godavarthy
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While taking a mock exam, I've come across a question that asks for correct DD element for specifying whether a attribute is required or not in a tag. The options were:
1.<required>yes</required>
2.<required/>
3.<attribute required="true"/>
4.<attribute required="yes"/>

It says 1st option is correct. But i feel none of the options are correct. But I had to choose one so I've selected 2nd. Now my Qs
1. Can we have yes/no as the values for boolean type of DD/TLS elements. e.g. <rtexprvalue> etc
2. Can we have empty element '<required/>'
-Thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
'required' is a j2ee:generic-booleanType (see web-jsptaglibrary_2_0.xsd)
The generic-booleanType is an extension of xsd:boolean which add 'yes' and 'no' to the already existing 'true' and 'false'.

So you may set 'required' to true, false, yes or no.
 
Umakanth Godavarthy
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Satou
Oh thats an eye opener

Can we have empty <required/>
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Umakanth:
Can we have empty <required/>


In the xsd :
If not present then the default is "false", i.e the attribute is optional.

Writing <required/> should then default to 'false'
[ December 05, 2005: Message edited by: Satou kurinosuke ]
 
fred rosenberger
lowercase baba
Bartender
Posts: 12266
36
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Umakanth,

Glad you're here, but i think you missed our naming policy when you registered. it basically requires a real sounding first name, a space, and last name.

could you please go here and update your name for us?

thanks,

and we'll see you 'round the ranch.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic