When Webgenz finds a Macro Value, it may alter that Macro Value before it replaces the Macro Tag with the
Macro Value. Why would Webgenz do this? Webgenz would do this in order to preserve the formatting of the
final HTML document that is generated by Webgenz. Here's and example:
Consider the following Template File:
<HTML>
<HEAD>
<TITLE>My Title</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR>
<TD>
[@MY_CONTENT]
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
And the following Content File:
[@MY_CONTENT]:
This is a block of content that
is a few lines long. This is
just an example.
[@]
If Webgenz were to simply insert the Macro Value in place of the Macro Tag, the result would be the following:
<HTML>
<HEAD>
<TITLE>My Title</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR>
<TD>
This is a block of content that
is a few lines long. This is
just an example.
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Since the formatting of this output is undesirable, Webgenz will alter the Macro Value. Webgenz will add
whatever characters appear before and after the Macro Tag in the Template file (usually just
white space) to each line of the Macro Value. In the example above, the output will be as follows:
<HTML>
<HEAD>
<TITLE>My Title</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR>
<TD>
This is a block of content that
is a few lines long. This is
just an example.
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
As you can see, this formatting is much more desirable and reflects the formatting that the
author of the Template File intended. However, this feature can be the source of confusion.
To see what I mean, lets assume that the Template File in the example above is the following:
<HTML>
<HEAD>
<TITLE>My Title</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR>
<TD>[@MY_CONTENT]</TD>
</TR>
</TABLE>
</BODY>
</HTML>
In this case, Webgenz will generate the following:
<HTML>
<HEAD>
<TITLE>My Title</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR>
<TD>This is a block of content that</TD>
<TD>is a few lines long. This is</TD>
<TD>just an example.</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Obviously, this is very undesirable. However, it is a side effect of the fact that Webgenz
is designed to maintain the formatting and indentation that appears in the Template File so that the
generated file will have the same formatting that it would have if you were to write it by hand.
So, if you find yourself with Webgenz output that you do not understand, just make sure that you
place the Macro Tag on a line by itself in the Template File.