Hi all!

I'm struggling with a problem that has do with how my taglib inserts do { or . 
do { strings at the start of blocks. 

I've created a boolean tag, that checks a submitted clear-text password 
against an encrypted version, and depending on the match, it will do 
something and return some markup or do something else and return some 
different nodes. For example:
      <user:password-matches>
        <user:username><param:credential_0/></user:username>
        <user:clear><param:passwd/></user:clear>
        <user:true>
          <auth:login/>
          <strong>Password is valid</strong>
        </user:true>
        <user:false><em>Password is invalid</em></user:false>
      </user:password-matches>

My own taglib is a SimpleTaglib taglib, but I'm using Mark's 
AxKit::XSP::BasicAuth for the authentication now. I'm sure it can be done 
much simpler, and I think the important thing is that I'm mixing 
SimpleTaglib-taglibs and TaglibHelper-taglibs. 

The XSP Perl that results is something like this:
                do {
                    if (   $attr_clear
                        && $encrypted
                        && (crypt($attr_clear, $encrypted) eq $encrypted))
                    {
                        . do {                   
                            my $args = Apache::Request->instance($r)->parms;

So, the first stuff here is from my taglib, but the final line is from 
BasicAuth. The problem is the tiny little . before do... That results of 
course, in an error. It shouldn't be there. 

I think I have encountered something similar before, in February, a thread 
starting at http://maclux-rz.uibk.ac.at/maillists/axkit-users/msg04663.shtml
It never got to anything, but I have that minimal example lying around 
somewhere. I guess it could be a SimpleTaglib problem, but as I tend to like 
SimpleTaglib, it would prefer to get it working with SimpleTaglib. But I 
guess Jörg is a busy man, so I think I have to try and understand what's 
happening myself.

So, I've tracked down where it comes from in ::::Language::XSP:
   elsif ($tag eq 'expr') {
        if 
(Apache::AxKit::Language::XSP::is_xsp_namespace($node->{Parent}->{NamespaceURI})) 
{
            if (!$e->manage_text() || $node->{Parent}->{Name} =~ 
/^(?:.*:)?(?:content|element)$/) {
                return '__mk_text_node($document, $parent, "" . do {';
            }
            elsif ($node->{Parent}->{Name} =~ /^(.*:)?(logic|expr)$/) {
                return 'do {';
            }
            return ' . do {';
        }

So, the tag is of expr type, that's why we get in here. It is the final return 
we get, but what we really should have gotten in this case, is the 
do {
and, I think in the stuff I had in February, the other way around. 

I can see that it chooses this based on what the name of the parent was, but 
that's where my understanding stops, how are these things assigned when it 
comes to taglibs? What is it that can make the name wrong, so that the wrong 
string is appended to the script?

Can anybody enlighten me?

Best,

Kjetil


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to