2004
01
02
03
04
05
06
07
08
09
10
11
12
2005
01
02
03
04
05
06
07
08
09
10
11
12
2006
01
02
03
04
05
06
07
08
09
10
11
12
2007
01
02
03
04
05
06
07
08
09
10
11
12
2008
01
02
03
04
05
06
07
08
09
10
11
12
Re: Re: [mod-xslt dev] media-type isn't changing latypoff
From : latypoff@xxxxxxxxx
To : dev@xxxxxxxxxxxxxxxx
Subject : Re: Re: [mod-xslt dev] media-type isn't changing
Date : Tue, 5 Jul 2005 11:32:50 +0200 (CEST)
I found the bug!
example #1 (wrong, but it was work under mod_xslt bu Philipp Dunkel):
test.xml:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="/path/to/xsl/test.xsl"?>
<page title="Test" xmlns:xi="http://www.w3.org/2001/XInclude" ;>
<content>
<title>Just test</title>
<para><![CDATA[This is test]]></para>
</content>
</page>
test.xsl:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet extension-element-prefixes="yaslt"
xmlns:yaslt="http://www.mod-xslt2.com/ns/1.0" ;
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ;
xmlns="http://www.w3.org/1999/xhtml" ;
version="1.0">
<xsl:import
href="/path/to/xsl/main.xsl" />
<!--
[some specific rules for test.xml]
-->
</xsl:stylesheet>
main.xsl:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ;
xmlns:yaslt="http://www.mod-xslt2.com/ns/1.0" ;
xmlns="http://www.w3.org/1999/xhtml" ;
extension-element-prefixes="yaslt"
version="1.0">
<xsl:output media-type="text/html" method="xml" encoding="utf-8"
indent="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" ;
/>
<xsl:strip-space elements="*" />
<!--
[main rules for hole site]
-->
</xsl:stylesheet>
--------------------------
example #2 (works properly right under mod-xslt2 and mod_xslt by P. Dunkel):
test.xml and main.xsl are the same as above
test.xsl:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet extension-element-prefixes="yaslt"
xmlns:yaslt="http://www.mod-xslt2.com/ns/1.0" ;
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ;
xmlns="http://www.w3.org/1999/xhtml" ;
version="1.0">
<xsl:import href="/path/to/xsl/main.xsl" />
<xsl:output media-type="text/html" method="xml" encoding="utf-8"
indent="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" ;
/>
<!--
[some specific rules for test.xml]
-->
</xsl:stylesheet>
------------------
in example #1 content-type in http headers is text/xml because mod-xslt
cannot find media-type (I was added some debug calls in modxslt-doc.c and saw
that document->stylesheet->mediaType is NULL in function mxslt_doc_parse())
in example #2 mediaType successfully found by parser.
libxml2-2.6.16
libxslt-1.1.12
pcre-6.1
apache2.0.54
solution #2 solve my problem but, I think example #1 must work under any
xslt-processors
sorry for my english, thanks ;)