now all xslt is server side - great...
git-svn-id: http://yolanda.mister-muffin.de/svn@204 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
parent
93d21c2272
commit
47ebae3b4e
1 changed files with 20 additions and 38 deletions
|
@ -135,47 +135,29 @@ sub urlencode
|
||||||
|
|
||||||
sub output_page
|
sub output_page
|
||||||
{
|
{
|
||||||
if($query->http('USER_AGENT') =~ m{(Firefox/[2-3]|MSIE [6-7]|yolanda-upload)})
|
use XML::LibXSLT;
|
||||||
{
|
use XML::LibXML;
|
||||||
#print xml
|
|
||||||
return $session->header(
|
|
||||||
-type=>'text/xml',
|
|
||||||
-charset=>'UTF-8'
|
|
||||||
),
|
|
||||||
XMLout(
|
|
||||||
$page,
|
|
||||||
KeyAttr => {},
|
|
||||||
XMLDecl => $XMLDecl,
|
|
||||||
RootName => 'page',
|
|
||||||
AttrIndent => '1'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
use XML::LibXSLT;
|
|
||||||
use XML::LibXML;
|
|
||||||
|
|
||||||
my $parser = XML::LibXML->new();
|
my $parser = XML::LibXML->new();
|
||||||
my $xslt = XML::LibXSLT->new();
|
my $xslt = XML::LibXSLT->new();
|
||||||
|
|
||||||
my $stylesheet = $xslt->parse_stylesheet($parser->parse_file("$root/xsl/xhtml.xsl"));
|
my $stylesheet = $xslt->parse_stylesheet($parser->parse_file("$root/xsl/xhtml.xsl"));
|
||||||
|
|
||||||
return $session->header(
|
return $session->header(
|
||||||
-type=>'text/xml',
|
-type=>'text/xml',
|
||||||
-charset=>'UTF-8'
|
-charset=>'UTF-8'
|
||||||
),
|
),
|
||||||
$stylesheet->output_string(
|
$stylesheet->output_string(
|
||||||
$stylesheet->transform(
|
$stylesheet->transform(
|
||||||
$parser->parse_string(
|
$parser->parse_string(
|
||||||
XMLout(
|
XMLout(
|
||||||
$page,
|
$page,
|
||||||
KeyAttr => {},
|
KeyAttr => {},
|
||||||
XMLDecl => $XMLDecl,
|
XMLDecl => $XMLDecl,
|
||||||
RootName => 'page',
|
RootName => 'page',
|
||||||
AttrIndent => '1'
|
AttrIndent => '1'
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
)
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue