Hi!
A Recent upgrade to AxKit 1.6 broke my tweaked ESQL tagib, so I just
re-tweaked it. This version supports two more things:
a) get-float and get-double take a "format" attribute for fancy output
b) get-xml is able to retrieve not-UTF-8 content (simply added a
encodeToUTF8() at the right place.
The patch for ESQL-1.4 is attached
Best reagrds
Olaf
--
Olaf P�schel, Softwaretechnik, OLMOS Workstations GmbH, Germany
Wolfenb�tteler Str. 31A, 38102 Braunschweig, Fon.: +49-531-22020-0 Fax: -99
OLMOS supports signed and/or encrypted mail. Grab my key at www.keyserver...net
"Unix *is* user friendly. It's just a bit picky about its friends"
*** ESQL.pm Sat Nov 30 13:06:53 2002
--- ESQL.pm.orig Sat Nov 30 11:31:27 2002
***************
*** 114,120 ****
sub get_count {
my ($ancestor) = @_;
$ancestor ||= 0;
! # warn("get_count: returning " . $COUNT[$ancestor] . "\n");
return $COUNT[$ancestor];
}
--- 114,120 ----
sub get_count {
my ($ancestor) = @_;
$ancestor ||= 0;
! warn("get_count: returning " . $COUNT[$ancestor] . "\n");
return $COUNT[$ancestor];
}
***************
*** 249,255 ****
elsif ($tag eq 'column') {
return '$col = ""';
}
! elsif ($tag =~ /^get-(column|string|boolean|int|long|short)$/) {
$e->start_expr($tag);
my $code = '$col = ""; $ancestor = 0; $format = "";';
if (my $col = lc($attribs{column})) {
--- 249,255 ----
elsif ($tag eq 'column') {
return '$col = ""';
}
! elsif ($tag =~ /^get-(column|string|boolean|double|float|int|long|short)$/) {
$e->start_expr($tag);
my $code = '$col = ""; $ancestor = 0; $format = "";';
if (my $col = lc($attribs{column})) {
***************
*** 258,275 ****
$code .= '$ancestor = ' . ($attribs{ancestor} || 0) . ';';
return $code;
}
- elsif ($tag =~ /^get-(float|double)$/) {
- $e->start_expr($tag);
- my $code = '$col = ""; $ancestor = 0; $format = "%e";';
- if (my $col = lc($attribs{column})) {
- $code .= '$col = q|' . $col . '|;';
- }
- if (my $format = $attribs{format}) {
- $code .= '$format = q|' . $format . '|;';
- }
- $code .= '$ancestor = ' . ($attribs{ancestor} || 0) . ';';
- return $code;
- }
elsif ($tag =~ /^get-(date|time|timestamp)$/) {
$e->start_expr($tag);
my $code = '$col = ""; $ancestor = 0; $format = "";';
--- 258,263 ----
***************
*** 283,289 ****
return $code;
}
elsif ($tag eq 'get-xml') {
- $e->{XSP_encoding} = $attribs{encoding} || 'UTF-8';
my $code = '$col = ""; $ancestor = 0; $format = "";';
if (my $col = lc($attribs{column})) {
$code .= '$col = q|' . $col . '|;';
--- 271,276 ----
***************
*** 436,442 ****
return '';
}
elsif ($tag =~ /^get-(double|float)$/) {
! $e->append_to_script('sprintf($format, AxKit::XSP::ESQL::get_column($col,
$ancestor))');
$e->end_expr();
return '';
}
--- 423,429 ----
return '';
}
elsif ($tag =~ /^get-(double|float)$/) {
! $e->append_to_script('sprintf("%e", AxKit::XSP::ESQL::get_column($col,
$ancestor))');
$e->end_expr();
return '';
}
***************
*** 446,452 ****
return '';
}
elsif ($tag eq 'get-xml') {
- my $encoding = $e->{XSP_encoding};
my $util_include_expr = {
Name => 'include-expr',
NamespaceURI => $AxKit::XSP::Util::NS,
--- 433,438 ----
***************
*** 459,465 ****
};
$e->start_element($util_include_expr);
$e->start_element($xsp_expr);
! $e->append_to_script('XML::LibXML::encodeToUTF8(\'' . $encoding .'\',
AxKit::XSP::ESQL::get_column($col, $ancestor))');
$e->end_element($xsp_expr);
$e->end_element($util_include_expr);
return '';
--- 445,451 ----
};
$e->start_element($util_include_expr);
$e->start_element($xsp_expr);
! $e->append_to_script('AxKit::XSP::ESQL::get_column($col, $ancestor)');
$e->end_element($xsp_expr);
$e->end_element($util_include_expr);
return '';
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]