• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I get the unevaluated body content of the tag

 
Gnanasekaran Sakthivel
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to change the unevaluated body content of the tag and alter it and let it evaluate.
<lib:tag1>
<lib:tag2 attribute1="something" attribute2="something" etc />
</lib:tag1>

I have it this way and it does not work.
Tag1 extends BodyTagSupport, if I try to get the body content in the doInitBody, it is empty. If I get it in doAfterBody, it is already evaluated.

I really would like to take the content (I mean the <lib:tag2 .../>) and add/remove few more attributes conditionally and let it evaluate.

Can you help me?
 
Gnanasekaran Sakthivel
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it is not possible as I read in the documentation. Nested tag's contents will be processed before handing over to the enclosing tag.
I am going to try to modify the processed content conditionally.
Please let me know if I need to understand anything.
 
Stefan Evans
Bartender
Posts: 1640
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you have noticed, it is not really possible to add/remove attributes to the tag.
But it is perfectly valid to modify the values of attributes which get passed to the tag.

So have your outer tag export/define the variables, and the inner tag depend on them.
It ties them together a little, but if they are logically related anyway that is not necessarily a problem.

If you need to add/remove attributes I think the only way to do it would be to conditionally choose which tag to invoke.
ie



 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic