[Petal] strange behaviour

Fergal Daly fergal at esatclear.ie
Mon May 19 16:03:46 BST 2003


On Monday 19 May 2003 13:51, Jean-Michel Hiver wrote:
> > doesn't seem to work correctly. The define doesn't seem to have any 
effect. If 
> > you remove the line with *** it works fine. Any ideas? The generated code 
> > looks fine,
> 
> Nicely spotted! Will be fixed soon :)
> Cheers,

Welcome back.

While you're fixing that, here's a related problem that probably needs fixing. 
I discovered the problem above while trying to test this

<tag petal:define="thing true">
	<omitted petal:omit-tag="thing">
		<tag petal:define="thing false"></tag>
	</omitted>
</tag>

I guess that this will produce

<tag>
	
		<tag></tag>
	</omitted>
</tag>

but the first problem got in my way.

It's unlikely you'd ever do the above deliberately but it's quite possible 
that in some situations, the value used for the omit-tag test could have 
changed by the time you test it again at the end. Really it should only be 
tested once.

This would probably require another PIS tag specifically for omit-tags and a 
corresponding end tag, producing code somthing like

{
	my $omit_test = $hash->get("thing");
	if (not $omit_test)
	{
		print "<$tag_name>";
	}

	# code for the template inside the tag goes here

	if (not $omit_test)
	{
		print "</$tag_name>";
	}
}

F



More information about the Petal mailing list