* (bug 28817) Add reference help page link to API Modules
* (bug 29935) Improve formatting of examples in ApiParamInfo
* (bug 29938) list=users&usprop=rights shows rights the user doesn't have
+* (bug 24781) The API will include an XML namespace if the includexmlnamespace
+ parameter is set.
=== Languages updated in 1.18 ===
private $mRootElemName = 'api';
public static $namespace = 'http://www.mediawiki.org/xml/api/';
private $mDoubleQuote = false;
+ private $mIncludeNamespace = false;
private $mXslt = null;
public function __construct( $main, $format ) {
public function execute() {
$params = $this->extractRequestParams();
$this->mDoubleQuote = $params['xmldoublequote'];
+ $this->mIncludeNamespace = $params['includexmlnamespace'];
$this->mXslt = $params['xslt'];
$this->printText( '<?xml version="1.0"?>' );
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,
- array( 'xmlns' => self::$namespace ) + $this->getResultData(),
+ $data,
$this->getIsHtml() ? - 2 : null,
$this->mDoubleQuote
)
return array(
'xmldoublequote' => false,
'xslt' => null,
+ 'includexmlnamespace' => false,
);
}
return array(
'xmldoublequote' => 'If specified, double quotes all attributes and content',
'xslt' => 'If specified, adds <xslt> as stylesheet',
+ 'includexmlnamespace' => 'If specified, adds an XML namespace'
);
}