Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on Custom tags

 
sudhakar karnati
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

This is a question from Enthuware.

Consider the following description of a tag in a TLD:

<tag>
<name>SmilyTag</name>
<tag-class>com.enthuware.ctags.SmilyTag</tag-class>
<description>
Replaces emoticons such as , , and with images.
</description>
<body-content>tagdependent</body-content>
<attribute>
<name>name</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>

Which of the following statements regarding the above tag are correct?

a) It is an empty tag
b) It may be used as an empty tag.
c) It must have a body.
d) It must implement BodyTag interface.
e) It may take an attribute named 'name'. But if present, its value must be dynamic.

One of the correct answer is (d). and the explanation given is:
Since the body-content is tagdependent, it must implement the BodyTag interface.

Can any body explain this..I read HFSJ 1st edition two times but i think there is nothing mentioned that if bod-content is tagdepenedent it must implement BodyTag interface
 
Antonio Tercero
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the answer is wrong because a Simple Tag can define a tagdependent body too
 
sudhakar karnati
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The correct answers given for this are:

b) It may be used as an empty tag.
d) It must implement BodyTag interface.

What are the correct options for this question?

Thanks & Regards,
Sudhakar Karnati
 
Anand Bhatt
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is correct option:
b)It may be used as an empty tag.

But option d should not be correct choice for this ,as we can define a "tagdependent" as a body-content in case of simpleTaghandler as well.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic