grashoper has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to modify a transform to output a basic header graphic, my problem is that it seems to totally screw up my output when I do,I am not sure how to fix my problem. Hopefully someone out there can help me. My site is using asp and activestate perl. I have a subroutine for adverts as follows and also an xslt that outputs it, my graphic is the bnr_left.jpg file.
sub adverts { my $str = ""; if ($Session->{'showAds'} && $Session->{'isAuthenticated'}) { my $adverts = xmlFileData("Content", "adverts.xml", "adverts()") +; $adverts .= xmlFileData("Content/Adverts", $Session->{'usrSystem +'}.$Session->{'usrAccount'}.".xml", "adverts()") ? xmlFileData("Conte +nt/Adverts", $Session->{'usrSystem'}.$Session->{'usrAccount'}.".xml", + "adverts()") : xmlFileData("Content/Adverts", $Session->{'usrSystem' +}.".xml", "adverts()"); $adverts =~ s/<\/adverts>\s*?<adverts>//g; my $i = 0; while ($adverts =~ s/id=""/id="$i"/) { $i++; } if ($i) { my $currentAdvert = $min % $i; if ($adverts =~ /(<advert id="$currentAdvert".*?\/>)/) { $str = "<adverts>$1</adverts>"; } } } return $str;
my transform (section applying to adverts
<xsl:template match="adverts"> <div id="adverts"> <table width="{/document/@docWidth}" border="0" cellpadding="0" +cellspacing="0" align="left"> <tr> <td style="text-align:left;" height="60" width="468"> <img src="images/revbnr_left.jpg"/> <xsl:if test="count(advert) &gt; 0"> <a href="{/document/@this}?{/document/@queryString}&amp;x +URL={advert/@url}"><img src="{advert/@src}" height="{advert/@height}" + width="{advert/@width}" alt="{advert/@alt}"/></a> </xsl:if> </td> <td style="text-align:right;vertical-align:middle;" height=" +1"> <xsl:if test="count(/document/config/includeLiveHelp) &g +t; 0 and /document/config/includeLiveHelp/@startTime &lt; /document/@ +time and /document/config/includeLiveHelp/@endTime &gt; /document/@ti +me"> <a href="http://server.iad.liveperson.net/hc/15823 +250/?cmd=file&amp;file=visitorWantsToChat&amp;site=15823250&amp;byhre +f=1&amp;VISITORVAR!Username={/document/config/includeLiveHelp/@userna +me}&amp;VISITORVAR!Account={/document/config/includeLiveHelp/@account +}&amp;VISITORVAR!System={/document/config/includeLiveHelp/@system}&am +p;VISITORVAR!Password={/document/config/includeLiveHelp/@password}" target="chat15823250" + onClick="javascript:window.open('http://server. +iad.liveperson.net/hc/15823250/?cmd=file&amp;file=visitorWantsToChat& +amp;site=15823250&amp;VISITORVAR!Username={/document/config/includeLi +veHelp/@username}&amp;VISITORVAR!Account={/document/config/includeLiv +eHelp/@account}&amp;VISITORVAR!System={/document/config/includeLiveHe +lp/@system}&amp;VISITORVAR!Password={/document/config/includeLiveHelp +/@password}&amp;referrer='+escape(document.location),'chat15823250',' +width=472,height=320,location=no,top=0,left=0,resizable=yes,status=no +');return false;"> <img src="http://server.iad.liveperson.net/hc/15 +823250/?cmd=repstate&amp;site=15823250&amp;ver=1&amp;category=en;woma +n;7" name="hcIcon" width="165" height="60" border="0"/> </a> </xsl:if>
my problem is once the transform runs my document is offset to the right and looks really screwed up. I am using a heredoc, and this was all done by someone else, it needs a rewrite, but so far maintenance of it is taking all my time.