You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axkit-dev@xml.apache.org by ma...@apache.org on 2002/07/05 21:02:36 UTC
cvs commit: xml-axkit/lib/Apache/AxKit Provider.pm
matts 2002/07/05 12:02:36
Modified: lib AxKit.pm
lib/Apache/AxKit Provider.pm
Log:
Styles patch from phish
Revision Changes Path
1.27 +10 -3 xml-axkit/lib/AxKit.pm
Index: AxKit.pm
===================================================================
RCS file: /home/cvs/xml-axkit/lib/AxKit.pm,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- AxKit.pm 29 Jun 2002 22:10:04 -0000 1.26
+++ AxKit.pm 5 Jul 2002 19:02:36 -0000 1.27
@@ -614,6 +614,13 @@
my $mapto = $style->{module};
+ # if no module is give AxKit should use the default modules
+ # from the server config.
+ unless ( $mapto ) {
+ my $mapping = $AxKit::Cfg->StyleMap;
+ $mapto = $mapping->{$style->{type}};
+ }
+
AxKit::load_module($mapto);
AxKit::Debug(3, "about to execute: $mapto\::handler");
@@ -817,12 +824,12 @@
AxKit::Debug(4, 'Sending gzipped xml string to browser');
AxKit::Apache::send_http_header($r);
if ($doit) {
- $r->print( unpack("U0A*", Compress::Zlib::memGzip(
+ $r->print( unpack($]>5.00555?"U0A*":"A*", Compress::Zlib::memGzip(
$transformer->( $r->pnotes('xml_string') )
) ) );
}
else {
- $r->print( unpack("U0A*", Compress::Zlib::memGzip( $r->pnotes('xml_string') ) ) );
+ $r->print( unpack($]>5.00555?"U0A*":"A*", Compress::Zlib::memGzip( $r->pnotes('xml_string') ) ) );
}
}
else {
1.12 +14 -2 xml-axkit/lib/Apache/AxKit/Provider.pm
Index: Provider.pm
===================================================================
RCS file: /home/cvs/xml-axkit/lib/Apache/AxKit/Provider.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Provider.pm 17 Jun 2002 23:15:47 -0000 1.11
+++ Provider.pm 5 Jul 2002 19:02:36 -0000 1.12
@@ -490,7 +490,19 @@
Extract the stylesheets from the XML resource. Should return an array
ref of styles. The style entries are hashes refs with required keys
-'href' and 'type'.
+'href', 'module' and 'type'.
+
+A sample return value of get_styles() could be:
+
+ [{ type => "text/xsl",
+ href => "path/to/your/stylesheet.xsl",
+ module => "Apache::AxKit::Language::LibXSLT" }]
+
+This allows one to use a different stylemapping than the default
+server configuration. If 'module' is ommited AxKit will apply the
+given default module for the type as it was added by 'AxAddStyleMap'
+in the configuration.
+
=head2 get_fh()