Hi,
Is it normal that a namespace has been added to the XML answer of the API with MW 1.18 ? I was quite busy lately, so I may have missed the announcement about this.
It means that answers from MW 1.18 are not compatible with answers from previous versions. How can we keep our tools working with both 1.18 and previous versions ?
Thanks Nico
<?xml version="1.0" encoding="UTF-8"?> <api xmlns="http://www.mediawiki.org/xml/api/">
On Thu, Oct 6, 2011 at 1:11 AM, Nicolas Vervelle nvervelle@gmail.com wrote:
Hi, Is it normal that a namespace has been added to the XML answer of the API with MW 1.18 ?
Someone requested this on Bugzilla and I implemented it.
I was quite busy lately, so I may have missed the announcement about this. It means that answers from MW 1.18 are not compatible with answers from previous versions.
How does it mean this, exactly?
Roan
On Thu, Oct 6, 2011 at 12:57 PM, Roan Kattouw roan.kattouw@gmail.comwrote:
On Thu, Oct 6, 2011 at 1:11 AM, Nicolas Vervelle nvervelle@gmail.com wrote:
Hi, Is it normal that a namespace has been added to the XML answer of the API with MW 1.18 ?
Someone requested this on Bugzilla and I implemented it.
I was quite busy lately, so I may have missed the announcement about
this.
It means that answers from MW 1.18 are not compatible with answers from previous versions.
How does it mean this, exactly?
Hi, thanks for answers.
Well, I'm using XPath in Java to find informations in the XML answer. Unless I missed something, I think I have to change a lot of things, and can't have my tool compatible with both 1.17 and 1.18.
Previously, when there was no namespace in the answer, I was using the XPath search path "/api/login" to analyse the result of login (in <api><login>) With the added namespace, this search path doesn't return anything because it doesn't match the namespace.
I have to add a definition for this namespace (for example, telling Java that "api" is equivalent to the added namespace), and change the XPath search path to "/api:api/api:login" to analyse the result of login. I have to change all XPath search pathes for every API request that I'm doing in my code. And this new XPath search pathes doesn't work for Wikipedia before 1.18.
So, I have a lot of modifications to make so that my tool works with 1.18, and it won't be compatible anymore with 1.17 or earlier.
Nico
On Thu, Oct 6, 2011 at 3:52 PM, Nicolas Vervelle nvervelle@gmail.com wrote:
Hi, thanks for answers. Well, I'm using XPath in Java to find informations in the XML answer. Unless I missed something, I think I have to change a lot of things, and can't have my tool compatible with both 1.17 and 1.18.
I was told by the people on Bugzilla (see https://bugzilla.wikimedia.org/show_bug.cgi?id=24781 ) that there wouldn't be any problems unless people were doing ugly things like regexing or something. Perhaps you should ask for help there. I know nothing about XML namespaces, I just did what my fellow MW devs asked me and had their assurance it wouldn't break things.
Roan
On Thu, Oct 6, 2011 at 3:57 PM, Roan Kattouw roan.kattouw@gmail.com wrote:
On Thu, Oct 6, 2011 at 3:52 PM, Nicolas Vervelle nvervelle@gmail.com wrote:
Hi, thanks for answers. Well, I'm using XPath in Java to find informations in the XML answer. Unless I missed something, I think I have to change a lot of things, and can't have my tool compatible with both 1.17 and 1.18.
I was told by the people on Bugzilla (see https://bugzilla.wikimedia.org/show_bug.cgi?id=24781 ) that there wouldn't be any problems unless people were doing ugly things like regexing or something. Perhaps you should ask for help there. I know nothing about XML namespaces, I just did what my fellow MW devs asked me and had their assurance it wouldn't break things.
I'm not doing any strange regexping, and everything I read on XPath and default namespace seems to point that XPath expressions are not compatible between a document without a default namespace (API 1.17) and a document with a default namespace (API 1.18). Comment #12 on bug 24781 is about the same problem : the change breaking code using XPath expressions.
Nico
mediawiki-api@lists.wikimedia.org