r88077 [1] added a default XML namespace (xmlns attribute on the root node) for the API's XML output.
In r99135 [2] this was partially backed out to avoid clobbering some modules that specified their own XML namespaces in output, such as RSD discovery info. With this change a query parameter needed to be added to include the namespace, but it would still clobber if you used it on affected modules.
In r101912 [3] I took the parameter out, returning almost to r88077's behavior -- but swapping the order of things so an xmlns contained in the output data will take precedence, avoiding the clobbering.
However I do want to confirm that this is an OK thing to do; as noted in a CR comment on [1] this may actually break XPath queries assuming the non-namespaced data. If there is a compat issue, we need to make sure it's documented and communicated...
[1] https://www.mediawiki.org/wiki/Special:Code/MediaWiki/88007 [2] https://www.mediawiki.org/wiki/Special:Code/MediaWiki/99135 [3] https://www.mediawiki.org/wiki/Special:Code/MediaWiki/101912
-- brion
On Thu, 03 Nov 2011 16:24:39 -0700, Brion Vibber brion@wikimedia.org wrote:
r88077 [1] added a default XML namespace (xmlns attribute on the root node) for the API's XML output.
In r99135 [2] this was partially backed out to avoid clobbering some modules that specified their own XML namespaces in output, such as RSD discovery info. With this change a query parameter needed to be added to include the namespace, but it would still clobber if you used it on affected modules.
In r101912 [3] I took the parameter out, returning almost to r88077's behavior -- but swapping the order of things so an xmlns contained in the output data will take precedence, avoiding the clobbering.
However I do want to confirm that this is an OK thing to do; as noted in a CR comment on [1] this may actually break XPath queries assuming the non-namespaced data. If there is a compat issue, we need to make sure it's documented and communicated...
[1] https://www.mediawiki.org/wiki/Special:Code/MediaWiki/88007 [2] https://www.mediawiki.org/wiki/Special:Code/MediaWiki/99135 [3] https://www.mediawiki.org/wiki/Special:Code/MediaWiki/101912
-- brion
I believe the change was actually backed out not because of RSD but because of said xpath issues.
The RSD issue sorta going away was just a side effect.
On Thu, Nov 3, 2011 at 5:18 PM, Daniel Friesen lists@nadir-seen-fire.comwrote:
I believe the change was actually backed out not because of RSD but because of said xpath issues.
The RSD issue sorta going away was just a side effect.
In that case the thing to do is to probably remove the namespace entirely and resolve 24781 as WONTFIX instead of FIXED. I don't think there's much benefit to adding a namespaced mode if nobody's ever going to bother using it because it's not default.
-- brion
On Thu, 03 Nov 2011 18:16:43 -0700, Brion Vibber brion@pobox.com wrote:
On Thu, Nov 3, 2011 at 5:18 PM, Daniel Friesen lists@nadir-seen-fire.comwrote:
I believe the change was actually backed out not because of RSD but because of said xpath issues.
The RSD issue sorta going away was just a side effect.
In that case the thing to do is to probably remove the namespace entirely and resolve 24781 as WONTFIX instead of FIXED. I don't think there's much benefit to adding a namespaced mode if nobody's ever going to bother using it because it's not default.
-- brion
;) or maybe LATER as in 'You'll get a namespace when we rewrite the api and shit like "*" and "boolean": "" stop showing up in the json fomat of the api'.
On Thu, Nov 3, 2011 at 6:21 PM, Daniel Friesen lists@nadir-seen-fire.comwrote:
On Thu, 03 Nov 2011 18:16:43 -0700, Brion Vibber brion@pobox.com wrote:
In that case the thing to do is to probably remove the namespace entirely and resolve 24781 as WONTFIX instead of FIXED. I don't think there's much benefit to adding a namespaced mode if nobody's ever going to bother using it because it's not default.
;) or maybe LATER as in 'You'll get a namespace when we rewrite the api and shit like "*" and "boolean": "" stop showing up in the json fomat of the api'.
Hehhehe. :)
For now I'll revert back to requireing the includexmlnamespace option, but keeping the tweak so using that option still won't break other XML outputs.
Looks like it could still be useful on internal requests, say when generating API data subsets to include in XMPP recentchanges (where it's nice to distinguish your payload with a namespace).
-- brion
On Thu, Nov 3, 2011 at 6:25 PM, Brion Vibber brion@pobox.com wrote:
For now I'll revert back to requireing the includexmlnamespace option, but keeping the tweak so using that option still won't break other XML outputs.
Done in r101944https://www.mediawiki.org/wiki/Special:Code/MediaWiki/101944. Should be no backwards-compatibility issues, as this restores the previous behavior (no xmlns on API hits unless you ask for 'includexmlnamespace' or the output format has its own), plus the logic tweak so outputs with their own xmlns don't get clobbered.
Glad I asked! :D
-- brion
wikitech-l@lists.wikimedia.org