You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Felix von Delius <fv...@t-online.de> on 2001/06/21 12:03:49 UTC
how to quote nested tags
A collegue asked me a question that I can't answer. Maybe someone
reading this list can help. The question is how to nest tags in a way
that they expand to their attribute values.
An example: assume I have the following tags:
<my:foo a='value' />
<my:bar b='other' />
<my:baz c='stuff' />
When I want to nest two of this tags, I can use alternating single and
double-quotes like this. This works and the expansion of the tags is
no problem:
<my:foo a='<my:bar b="stuff"/>' />
^-----^
^-------------------^
But what when I want to nest the tags deeper, alternating single-
and double quotes will not work, because the 2nd single quote will end
the 1st one and the taglib processor recognized this wrong structure:
<my:foo a='<my:bar b="<my:baz c='stuff' />" />' />
^---------------------^ ^-------^
My question now is: Is there a "right way" to do this? (Maybe using
" or some form of temporary variable to hold an immediate value)
Thanks for Your help!
-Felix
Re: how to quote nested tags
Posted by Oleg V Alexeev <go...@penza.net>.
Hello Felix,
Thursday, June 21, 2001, 2:03:49 PM, you wrote:
FvD> <my:foo a='<my:bar b="stuff"/>' />
FvD> ^-----^
FvD> ^-------------------^
You can use in tag attributes only run time expressions - not another
tag.
--
Best regards,
Oleg mailto:gonza@penza.net