Index: branches/wmf/1.18wmf1/RELEASE-NOTES-1.18 |
— | — | @@ -596,6 +596,8 @@ |
597 | 597 | * (bug 28817) Add reference help page link to API Modules |
598 | 598 | * (bug 29935) Improve formatting of examples in ApiParamInfo |
599 | 599 | * (bug 29938) list=users&usprop=rights shows rights the user doesn't have |
| 600 | +* (bug 24781) The API will include an XML namespace if the includexmlnamespace |
| 601 | + parameter is set. |
600 | 602 | |
601 | 603 | === Languages updated in 1.18 === |
602 | 604 | |
Property changes on: branches/wmf/1.18wmf1/RELEASE-NOTES-1.18 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
603 | 605 | Merged /trunk/phase3/RELEASE-NOTES-1.18:r99135 |
Index: branches/wmf/1.18wmf1/includes/api/ApiFormatXml.php |
— | — | @@ -38,6 +38,7 @@ |
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; |
42 | 43 | private $mXslt = null; |
43 | 44 | |
44 | 45 | public function __construct( $main, $format ) { |
— | — | @@ -59,15 +60,22 @@ |
60 | 61 | public function execute() { |
61 | 62 | $params = $this->extractRequestParams(); |
62 | 63 | $this->mDoubleQuote = $params['xmldoublequote']; |
| 64 | + $this->mIncludeNamespace = $params['includexmlnamespace']; |
63 | 65 | $this->mXslt = $params['xslt']; |
64 | 66 | |
65 | 67 | $this->printText( '<?xml version="1.0"?>' ); |
66 | 68 | if ( !is_null( $this->mXslt ) ) { |
67 | 69 | $this->addXslt(); |
68 | 70 | } |
| 71 | + if ( $this->mIncludeNamespace ) { |
| 72 | + $data = array( 'xmlns' => self::$namespace ) + $this->getResultData(); |
| 73 | + } else { |
| 74 | + $data = $this->getResultData(); |
| 75 | + } |
| 76 | + |
69 | 77 | $this->printText( |
70 | 78 | self::recXmlPrint( $this->mRootElemName, |
71 | | - array( 'xmlns' => self::$namespace ) + $this->getResultData(), |
| 79 | + $data, |
72 | 80 | $this->getIsHtml() ? - 2 : null, |
73 | 81 | $this->mDoubleQuote |
74 | 82 | ) |
— | — | @@ -201,6 +209,7 @@ |
202 | 210 | return array( |
203 | 211 | 'xmldoublequote' => false, |
204 | 212 | 'xslt' => null, |
| 213 | + 'includexmlnamespace' => false, |
205 | 214 | ); |
206 | 215 | } |
207 | 216 | |
— | — | @@ -208,6 +217,7 @@ |
209 | 218 | return array( |
210 | 219 | 'xmldoublequote' => 'If specified, double quotes all attributes and content', |
211 | 220 | 'xslt' => 'If specified, adds <xslt> as stylesheet', |
| 221 | + 'includexmlnamespace' => 'If specified, adds an XML namespace' |
212 | 222 | ); |
213 | 223 | } |
214 | 224 | |