Index: trunk/phase3/includes/api/ApiFormatXml.php |
— | — | @@ -38,7 +38,6 @@ |
39 | 39 | private $mRootElemName = 'api'; |
40 | 40 | public static $namespace = 'http://www.mediawiki.org/xml/api/'; |
41 | 41 | private $mDoubleQuote = false; |
42 | | - private $mIncludeNamespace = false; |
43 | 42 | private $mXslt = null; |
44 | 43 | |
45 | 44 | public function __construct( $main, $format ) { |
— | — | @@ -60,19 +59,19 @@ |
61 | 60 | public function execute() { |
62 | 61 | $params = $this->extractRequestParams(); |
63 | 62 | $this->mDoubleQuote = $params['xmldoublequote']; |
64 | | - $this->mIncludeNamespace = $params['includexmlnamespace']; |
65 | 63 | $this->mXslt = $params['xslt']; |
66 | 64 | |
67 | 65 | $this->printText( '<?xml version="1.0"?>' ); |
68 | 66 | if ( !is_null( $this->mXslt ) ) { |
69 | 67 | $this->addXslt(); |
70 | 68 | } |
71 | | - if ( $this->mIncludeNamespace ) { |
72 | | - $data = array( 'xmlns' => self::$namespace ) + $this->getResultData(); |
73 | | - } else { |
74 | | - $data = $this->getResultData(); |
75 | | - } |
76 | 69 | |
| 70 | + // If the result data already contains an 'xmlns' namespace added |
| 71 | + // for custom XML output types, it will override the one for the |
| 72 | + // generic API results. |
| 73 | + // This allows API output of other XML types like Atom, RSS, RSD. |
| 74 | + $data = $this->getResultData() + array( 'xmlns' => self::$namespace ); |
| 75 | + |
77 | 76 | $this->printText( |
78 | 77 | self::recXmlPrint( $this->mRootElemName, |
79 | 78 | $data, |
— | — | @@ -209,7 +208,6 @@ |
210 | 209 | return array( |
211 | 210 | 'xmldoublequote' => false, |
212 | 211 | 'xslt' => null, |
213 | | - 'includexmlnamespace' => false, |
214 | 212 | ); |
215 | 213 | } |
216 | 214 | |
— | — | @@ -217,7 +215,6 @@ |
218 | 216 | return array( |
219 | 217 | 'xmldoublequote' => 'If specified, double quotes all attributes and content', |
220 | 218 | 'xslt' => 'If specified, adds <xslt> as stylesheet', |
221 | | - 'includexmlnamespace' => 'If specified, adds an XML namespace' |
222 | 219 | ); |
223 | 220 | } |
224 | 221 | |