[ic] instant reparse? still not working, about to go crazy

Kevin Walsh interchange-users@icdevgroup.org
Thu Feb 20 10:08:01 2003


Marc Brevoort [marc.brevoort@armazemdedados.com] wrote:
> Speaking about unpredictable behaviour, I'm slowly going crazy here.
> 
> I've reduced the situation to the following.
> Given the following result page:
> 
> <html>
> <body>
> <h1>Result</h2>
> [perl]
>         my $page="";
>         $c007=$Session->{PayReference};
>         if ($c007 eq "") {
>                 $page.="Session var. lost, cannot continue.";
>                 die();
>         } else {
>                 $page.="Payment reference: $c007<br>\n";
>                 $CGI->{url}="https://cer.pnet.multibanco.pt/pvtn";
>                
> $CGI->{params}="A030=M020&A001=1266&C007=".$c007."&C013=";
>                 $page.="Connecting to
> ".$CGI->{url}."?".$CGI->{params}."<br>\n";        }
>         return $page;
> [/perl]
> [parsexml]<ABC>556</ABC>[/parsexml]
> [tmp hide]
> [parsexml][posttourl url="[cgi url]" params="[cgi params]"][/parsexml]
> [/tmp]
> Result=[cgi C016], ABC=[cgi ABC]
> </body>
> </html>
> 
> And the following (formerly) XML parser tag, after lots of simplifying:
> 
> Usertag parsexml hasEndTag
> Usertag parsexml Routine <<EOR
> sub {
> my ($xml)=@_;
> my $result="";
> sub cleanupxml {
> my ($xml)=@_;
> $result.="-----------------------cleanup-------------";
>         return $xml;
> }
> my $cleanxml=cleanupxml($xml);
> $result.="<br>".$cleanxml."<br>\n";
> return $result;
> 
> }
> EOR
> 
> The result that I get in my browser is:
> 
> Result
> Payment reference: 0009900211
> Connecting to
> https://cer.pnet.multibanco.pt/pvtn?A030=M020&A001=1266&C007=0009900211&C013=
> -----------------------cleanup-------------
> 556
> Result=2, ABC= 
> 
> I would expect the text '-------cleanup---------' to appear twice, after
> all I'm calling the [parsexml] tag twice, right? 
>
You'll have to use [scratch hide] to see the missing text, as you've
used [tmp hide]...[/tmp] to capture the tag's result.

I have some spare whitespace going cheap, if you need some. :-)

> 
> Also, when running things in Mozilla, the 'connecting to' link is not
> shown, while in Galeon it is; the error log shows that using mozilla the
> session variable is lost, though the html is server-generated and thus
> shouldn't be browser-dependant. In either case, I'd still expect two
> attempts to parse the xml.
> 
> Am I just too short on coffee not to see what's happening, or is
> something weird going on? Any clues?
> 
I suppose it would depend upon how your $Session->{PayReference} is
getting set?

By the way, it's dangerous to define your own session keys; That's
what the scratch space is for.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/