Mailing List Archive

Embperl
Why doesn't this work:
<tr[$ if ($ctr%2 != 0) $]BGCOLOR="#cccccc"[$ endif $]>

Yet this works:
<tr [$ if ($ctr%2 != 0) $]BGCOLOR="#cccccc"[$ endif $]>

The only difference is the space between <tr and [$

Is this a bug in Embperl or me?

ilia.
Re: Embperl [ In reply to ]
Ok let me elaborate and correct my first case:

[$ foreach $i @someArray $]
<tr[$ if ($ctr%2 == 0) $] BGCOLOR="#cccccc"[$ endif $]>
<td>...</td>
</tr>
[- $ctr++ -]
[$ endforeach $]

So the html (that should be produced) is fine. However, Embperl dies
with the error: </tr> without <tr>

Definitely, Embperl doesn't like absence of space at: <tr[.$
-because that is the only difference. Put a space before [$ and it
works.


Ilia Lobsanov wrote:
>
> Why doesn't this work:
> <tr[$ if ($ctr%2 != 0) $]BGCOLOR="#cccccc"[$ endif $]>
>
> Yet this works:
> <tr [$ if ($ctr%2 != 0) $]BGCOLOR="#cccccc"[$ endif $]>
>
> The only difference is the space between <tr and [$
>
> Is this a bug in Embperl or me?
>
> ilia.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
RE: Embperl [ In reply to ]
>
> Why doesn't this work:
> <tr[$ if ($ctr%2 != 0) $]BGCOLOR="#cccccc"[$ endif $]>
>
> Yet this works:
> <tr [$ if ($ctr%2 != 0) $]BGCOLOR="#cccccc"[$ endif $]>
>
> The only difference is the space between <tr and [$
>
> Is this a bug in Embperl or me?
>

The problem is that if the if is true you get

<trBGCOLOR="#cccccc">

and trBGCOLOR isn't a know HTML tag. So either a space before or after the
if is required.

Gerald
Re: Embperl [ In reply to ]
Gerald Richter wrote:
>
> >
> > Why doesn't this work:
> > <tr[$ if ($ctr%2 != 0) $]BGCOLOR="#cccccc"[$ endif $]>
> >
> > Yet this works:
> > <tr [$ if ($ctr%2 != 0) $]BGCOLOR="#cccccc"[$ endif $]>
> >
> > The only difference is the space between <tr and [$
> >
> > Is this a bug in Embperl or me?
> >
>
> The problem is that if the if is true you get
>
> <trBGCOLOR="#cccccc">
>
> and trBGCOLOR isn't a know HTML tag. So either a space before or after the
> if is required.
>
> Gerald

No, the first case does have a space before BGCOLOR... I just emailed
the wrong thing.... please see my follow-up email from yesterday. Thank
you.

ilia.
RE: Embperl [ In reply to ]
>
> No, the first case does have a space before BGCOLOR... I just emailed
> the wrong thing.... please see my follow-up email from yesterday. Thank
> you.
>

Yes, you are right, I was a little bit to fast with typing my answer...
(sometimes it better to think first ;-)

The Embperl parser requires a space after an html tag name or a closing >.

Gerald



-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------