There may be times when you wish to use an LXP variable value within the contents of an
HTML tag. For example, you may have a graphic with a dynamically assigned width. Since LXP only
performs variable value substitution within LXP tags, you cannot substitute an LXP variable
within an HTML tag as you would with an LXP tag. In other words, the
variable reference in the following example will not work:
<lxp> <!-- WRONG: LXP variable will not be substituted in non-LXP tag --> <img src="/images/spacer.gif" width="$width" /> </lxp>
You might think an obvious solution would be to place the LXP
<putvar> tag inside of the HTML tag. There is a problem with this approach,
however. Specifically, such syntax breaks the integrity of the mark-up of the document. For a
mark-up language to be well formed, tags must not be nested within the
actual contents of another tag as shown in this example:
<lxp> <!-- Not recommended: Tags should not be nested in one another --> <img src="/images/spacer.gif" width="<putvar name="width" />"> </lxp>
Note that nesting LXP tags within non-LXP tags can work in some circumstances, though it is not recommended. The LXP well-formedness requirements will probably grow more stringent in the future, and this kind of nesting is an easy way to make your LXP mark-up both lose its readability, as well as its mark-up integrity.
The LXP solution to this problem is the
<xtag> element. The
<xtag> is used as a wrapper to display any foreign ...