--- loncom/xml/lonxml.pm 2003/05/22 20:19:18 1.256
+++ loncom/xml/lonxml.pm 2003/05/22 21:05:01 1.257
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.256 2003/05/22 20:19:18 albertel Exp $
+# $Id: lonxml.pm,v 1.257 2003/05/22 21:05:01 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -521,6 +521,7 @@ sub inner_xmlparse {
my $string=$$style_for_target{$token->[1]}.
'';
&Apache::lonxml::newparser($pars,\$string);
+ $Apache::lonxml::style_values=$$parstack[-1];
} else {
$result = &callsub("start_$token->[1]", $target, $token, $stack,
$parstack, $pars, $safeeval, $style_for_target);
@@ -544,6 +545,7 @@ sub inner_xmlparse {
my $string=$$style_for_target{'/'.$token->[1]}.
'';
&Apache::lonxml::newparser($pars,\$string);
+ $Apache::lonxml::style_values=$$parstack[-1];
} else {
$result = &callsub("end_$token->[1]", $target, $token, $stack,
$parstack, $pars,$safeeval, $style_for_target);
@@ -553,10 +555,14 @@ sub inner_xmlparse {
}
#evaluate variable refs in result
if ($result ne "") {
+ my $extras;
+ if (!$Apache::lonxml::usestyle) {
+ $extras=$Apache::lonxml::style_values;
+ }
if ( $#$parstack > -1 ) {
- $result=&Apache::run::evaluate($result,$safeeval,$$parstack[-1]);
+ $result=&Apache::run::evaluate($result,$safeeval,$extras.$$parstack[-1]);
} else {
- $result= &Apache::run::evaluate($result,$safeeval,'');
+ $result= &Apache::run::evaluate($result,$safeeval,$extras);
}
}
if (($token->[0] eq 'T') || ($token->[0] eq 'C') || ($token->[0] eq 'D') ) {
@@ -1308,7 +1314,7 @@ sub error {
sub warning {
$warningcount++;
- if ($ENV{'request.state'} eq 'construct') {
+ if ($ENV{'request.state'} eq 'construct' || $Apache::lonxml::debug) {
print "WARNING:".join('
',@_)."
\n";
}
}