Subject: | Problem with multiple children to XSP taglib elements |
I have an issue I have mentioned on axkit-users (The missing dot again...). I have also created a minimal example, which I sent to Jörg, but he's busy. I think it is quite likely a bug, and I don't think it is in (just) SimpleTaglib, so I'm submitting it here. But first the basic details:
$ uname -a
Linux owl 2.4.20 #5 Wed Jan 1 22:21:59 CET 2003 i686 unknown
$ perl -v
This is perl, v5.6.1 built for i386-linux
Uhm, distribution name, is that any other than AxKit-1.61?
I have created a simple XSP:
<?xml-stylesheet href="NULL" type="application/x-xsp"?>
<xsp:page
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
xmlns:preview="http://www.skepsis.no/taglibs/preview/"
xmlns:param="http://axkit.org/NS/xsp/param/v1">
<html>
<body>
<h1>Submit Story</h1>
<preview:write-entry>
<preview:headline><param:headline/></preview:headline>
<preview:content><param:content/></preview:content>
<preview:username><param:headline/></preview:username>
<preview:linktext><param:content/></preview:linktext>
</preview:write-entry>
</body>
</html>
</xsp:page>
And a simple SimpleTaglib (what this was supposed to do originally is irrelevant):
# Skepsis::XSP::Pr.pm
package Skepsis::XSP::Pr;
use strict;
use Apache::AxKit::Language::XSP::SimpleTaglib;
use Apache::AxKit::Exception;
use DBI;
use AxKit;
$Skepsis::XSP::Pr::VERSION = 0.1;
$Skepsis::XSP::Pr::NS = 'http://www.skepsis.no/taglibs/preview/';
#Axkit::Debug(6, "Skepsis::XSP::Pr loaded");
package Skepsis::XSP::Pr::Handlers;
# Store entered data in the database
sub write_entry : node(status) attribOrChild(headline,content,username,linktext)
{
return << 'EOC';
warn("do nothing");
EOC
}
The problem occurs if I have more than one line with parameters to write_entry, e.g. if I have
<preview:headline><param:headline/></preview:headline>
<preview:content><param:content/></preview:content>
I get errors such as
[Fri Feb 7 18:34:40 2003] [error] [client 195.1.208.96] [AxKit]
[Backtrace] Compilation failed: syntax error at (eval 83) line 57, near
"""__mk_text_node"
syntax error at (eval 83) line 58, at EOF
57 do { $attr_content = ""__mk_text_node($document, $parent, "" . do
{$cgi->param(q|content|)}); # xsp tag
58 ; ; };
It seems like the XSP is missing a . which would make the syntax correct.
However, if I have only one line, like
<preview:headline><param:headline/></preview:headline>
there is no problem.
The reason why I think it has nothing to do with SimpleTaglib is that pretty much the same thing happens with TaglibHelper.
This is the error that result:
[Fri Feb 7 18:35:25 2003] [error] [client 195.1.208.96] [AxKit] [Error]
Compilation failed: syntax error at (eval 81) line 60, near """
__mk_text_node"
and this is the relevant (?) XSP:
59 $_args{content} = ""
60 __mk_text_node($document, $parent, "" . do
{$cgi->param(q|content|)}); # xsp tag
61 ;
However, the enclosed XSP and taglib should be sufficient to reproduce the problem, so don't rely on my error messages! :-)