Hi
I'm using SimpleTaglib and have put quite a lot of time into making my
taglib. I now find, and I quote from
http://search.cpan.org/src/MSERGEANT/AxKit-1.6/demo/AxKit/XSP/Demo/Objec
t.pm
"Note that this is an important limitation: We cannot use any content of
the tag in the opening tag handler, just attributes."
Arrr!
My taglib not unlike esql. I wish to provide an 'environment' in XSP so
any tags under my tag <ns:env> have access to some variables, say for
sake of argument 'var1' is one of those variables (in the case of esql
the variable is a database connection). I would like the variable to be
passed as either an attribute or a child tag so both:
<ns:env var1="foo">
<bar>
<ns:whatisvar1/>
</bar>
</ns:env>
and (where var1 can be 'dynamic'):
<ns:env>
<ns:var1>foo</ns:var1>
<bar>
<ns:whatisvar1/>
</bar>
</ns:env>
would give:
<bar>
foo
</bar>
Ideally I would like:
sub env__open : attribOrChild(var1){
return << 'EOC';
#and have access to var1, if it's a child tag, here.
EOC
}
But this is not possible because of the limitation sated above.
I could work around like this:
sub env__open attrib(var1){
return << 'EOC';
my $_xsp_ns_var1;
$_xsp_ns_var1 = $attr_var1;
EOC
}
sub var1 : captureContent{
return << 'EOC';
$_xsp_ns_var1 = $_;
EOC
}
But I then have a problem if I wish to run code to process var1 (like
esql opens the connection) before it is made available to subsequent
tags. If I put the code in 'sub env__open' it will not have access to
$attr_var1 when var1 is a child tag. If I put the code in 'sub var1' it
will not get executed when var1 is an attribute.
This must be a common functionality or do I have a misconception of how
to use simple taglib and XSP for that matter?
Can anyone tell me a good work around? Or weather I'm tackling things in
the wrong way.
Your help is much appreciated.
Adam
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]