Index: api/ApiFormatXml.php =================================================================== --- api/ApiFormatXml.php (revision 59374) +++ api/ApiFormatXml.php (working copy) @@ -173,7 +173,7 @@ $this->setWarning( 'Stylesheet should have .xsl extension.' ); return; } - $this->printText( 'escapeLocalURL( 'action=raw' ) . '" type="text/xml" ?>' ); + $this->printText( 'escapeLocalURL( 'action=raw&ctype=application/xml' ) . '" type="text/xsl" ?>' ); } public function getAllowedParams() { Index: RawPage.php =================================================================== --- RawPage.php (revision 59374) +++ RawPage.php (working copy) @@ -26,6 +26,9 @@ $allowedCTypes = array('text/x-wiki', $wgJsMimeType, 'text/css', 'application/x-zope-edit'); $this->mArticle =& $article; $this->mTitle =& $article->mTitle; + if ($article->mTitle->getNamespace() == NS_MEDIAWIKI) { + $allowedCTypes[] = 'application/xml'; + } if( $request === false ) { $this->mRequest =& $wgRequest;