[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mason
Subject:    Re: [Mason] possible bug with "component-with-content ending tags"
From:       "P. Fleury" <fleury () users ! sourceforge ! net>
Date:       2003-10-20 0:26:30
[Download RAW message or body]

Hi James,

I think you can't mix Mason logic and Perl logic this way. It is not as
seamless.

The same applies her: immagine that the <&| ... > tag is simply replaced
by some Perl code, which is valid perl only in the presence of the
corresponding </&>. Then, interleaving other Perl constructs will result
in invalid perl, and hence an error when serving the page.
Think Preprocessor and C++, you cannot interleave the conditional logic
with the C++ logic without being careful.

Note that Mason does not "simple replacing", it does a bit more, but to
understand roughly its limits, it's a user model which served me well :-)

--Pascal

james oliver wrote:

>Hi,
>
>I think I found a bug. I use Mason 1.21 and Apache/1.3.26. Following is 
>a short example:
>
>My Mason component:
>
>-------------------------------------------------------
><%flags>
>     inherit=>undef
></%flags>
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>
><html>
><head></head>
><body>
>
>% if (defined $ARGS{one}) {
>     <&| onefilter &>
>     </&>
>% } elsif (defined $ARGS{two}) {
>     <&| twofilter &>
>     </&>
>% }
>
>
></body>
></html>
>
><%def onefilter>
></%def>
>
><%def twofilter>
></%def>
>-------------------------------------------------------
>
>
>This way everything is okay. I tried to put the "</&>" Tags out of the 
>conditional blocks and only have one after them because only one of the 
>two conditional blocks will execute and the text within the 
>component-with-content blocks would be the same.
>
>The important portion of the variation of the code looks as follows:
>
>
>-------------------------------------------------------
>% if (defined $ARGS{one}) {
>     <&| onefilter &>
>% } elsif (defined $ARGS{two}) {
>     <&| twofilter &>
>% }
>
></&>
>-------------------------------------------------------
>
>
>When I tried to load the page the following error occured:
>
>| Not enough component-with-content ending tags found at [...]
>
>
>That's why I undid my changes so the code looks like my first example 
>again. When I try to load the page again there's still the error I  got 
>before - this time at line 1.
>
>I have to restart my Apache server to get the code running again.
>
>HTH,
>James
>
>
>
>
>
>
>-------------------------------------------------------
>This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
>The Event For Linux Datacenter Solutions & Strategies in The Enterprise 
>Linux in the Boardroom; in the Front Office; & in the Server Room 
>http://www.enterpriselinuxforum.com
>_______________________________________________
>Mason-users mailing list
>Mason-users@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/mason-users
>  
>




-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise 
Linux in the Boardroom; in the Front Office; & in the Server Room 
http://www.enterpriselinuxforum.com
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic