Dear all,
I have tried to convert XML format (e.g. http://en.wikipedia.org/w/api.php?action=opensearch&search=apple&for...) to JSON format by using xml2json (http://www.thomasfrank.se/xml_to_json.html) . This worked well a couple of months ago. However recently there is an error with the new XML format that includes: xml:space="preserve" as attribute for each node.
I wonder how this problem could be solved.
Best,
Borort
On Sun, 2009-06-28 at 23:03 +0700, Borort wrote:
Dear all,
I have tried to convert XML format (e.g. http://en.wikipedia.org/w/api.php?action=opensearch&search=apple&for...) to JSON format by using xml2json
Just out of interest, why do you not output as json directly?
format=json ?
Best Regards
Jools
The reason that i don't use format=json is it will not return the description and url of the result..
On Mon, Jun 29, 2009 at 12:08 AM, Jools Wills buzz@exotica.org.uk wrote:
On Sun, 2009-06-28 at 23:03 +0700, Borort wrote:
Dear all,
I have tried to convert XML format (e.g.
http://en.wikipedia.org/w/api.php?action=opensearch&search=apple&for...) to JSON format by using xml2json
Just out of interest, why do you not output as json directly?
format=json ?
Best Regards
Jools
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
I always use php format so that I wont need to load any parsers ( XML or JSON or YAML) -Cheers
On Sun, Jun 28, 2009 at 10:48 PM, Borort borort@gmail.com wrote:
The reason that i don't use format=json is it will not return the description and url of the result..
On Mon, Jun 29, 2009 at 12:08 AM, Jools Wills buzz@exotica.org.uk wrote:
On Sun, 2009-06-28 at 23:03 +0700, Borort wrote:
Dear all,
I have tried to convert XML format (e.g.
http://en.wikipedia.org/w/api.php?action=opensearch&search=apple&for...) to JSON format by using xml2json
Just out of interest, why do you not output as json directly?
format=json ?
Best Regards
Jools
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
2009/6/28 Jools Wills buzz@exotica.org.uk:
On Mon, 2009-06-29 at 00:18 +0700, Borort wrote:
The reason that i don't use format=json is it will not return the description and url of the result..
hmm I think it should so this could be a bug.
Actually, both the JSON opensearch format and the XML opensearch format are documented standards, but with different fields. IIRC, the opensearch module will refuse to output anything but these two, and will output JSON even if you set format=php. It's only intended to be used for browser search plugins (JSON for Firefox, XML for IE); for other purposes, you're probably better off using list=search or list=allpages&apprefix=Foo instead.
Roan Kattouw (Catrope)
Borort wrote:
Dear all,
I have tried to convert XML format (e.g. http://en.wikipedia.org/w/api.php?action=opensearch&search=apple&for... http://en.wikipedia.org/w/api.php?action=opensearch&search=apple&format=xml) to JSON format by using xml2json (http://www.thomasfrank.se/xml_to_json.html) . This worked well a couple of months ago. However recently there is an error with the new XML format that includes: xml:space="preserve" as attribute for each node.
I wonder how this problem could be solved.
Best,
Borort
Report to xml2json developers that their tool doesn't support xml:space="preserve" attribute. Alternatively, you could use http://en.wikipedia.org/w/api.php?action=opensearch&search=apple&for...
mediawiki-api@lists.wikimedia.org