From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- includes/api/ApiFormatXml.php | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'includes/api/ApiFormatXml.php') diff --git a/includes/api/ApiFormatXml.php b/includes/api/ApiFormatXml.php index 45ab73ef..3bdfdfa3 100644 --- a/includes/api/ApiFormatXml.php +++ b/includes/api/ApiFormatXml.php @@ -1,6 +1,6 @@ extractRequestParams(); $this->mDoubleQuote = $params['xmldoublequote']; + $this->mIncludeNamespace = $params['includexmlnamespace']; $this->mXslt = $params['xslt']; $this->printText( '' ); if ( !is_null( $this->mXslt ) ) { $this->addXslt(); } + if ( $this->mIncludeNamespace ) { + $data = array( 'xmlns' => self::$namespace ) + $this->getResultData(); + } else { + $data = $this->getResultData(); + } + $this->printText( self::recXmlPrint( $this->mRootElemName, - $this->getResultData(), + $data, $this->getIsHtml() ? - 2 : null, $this->mDoubleQuote ) @@ -85,6 +94,13 @@ class ApiFormatXml extends ApiFormatBase { * * If neither key is found, all keys become element names, and values become element content. * The method is recursive, so the same rules apply to any sub-arrays. + * + * @param $elemName + * @param $elemValue + * @param $indent + * @param $doublequote bool + * + * @return string */ public static function recXmlPrint( $elemName, $elemValue, $indent, $doublequote = false ) { $retval = ''; @@ -193,6 +209,7 @@ class ApiFormatXml extends ApiFormatBase { return array( 'xmldoublequote' => false, 'xslt' => null, + 'includexmlnamespace' => false, ); } @@ -200,6 +217,7 @@ class ApiFormatXml extends ApiFormatBase { return array( 'xmldoublequote' => 'If specified, double quotes all attributes and content', 'xslt' => 'If specified, adds as stylesheet', + 'includexmlnamespace' => 'If specified, adds an XML namespace' ); } @@ -208,6 +226,6 @@ class ApiFormatXml extends ApiFormatBase { } public function getVersion() { - return __CLASS__ . ': $Id: ApiFormatXml.php 73753 2010-09-25 16:56:03Z reedy $'; + return __CLASS__ . ': $Id: ApiFormatXml.php 104476 2011-11-28 20:08:17Z reedy $'; } } -- cgit v1.2.3-54-g00ecf