I think I sent this to the wrong address initially, here it is again (sorry if I'm just getting confused),
Dan.
---------- Forwarded message ---------- From: Dan Bolser dan.bolser@gmail.com Date: 1 October 2011 10:37 Subject: API for Extension:ExpandTemplates? To: "mediawiki-l@lists.wikimedia.org" mediawiki-l-bounces@lists.wikimedia.org
Hi,
Can I get the XML parse tree from the MW API using Extension:ExpandTemplates? http://www.mediawiki.org/wiki/Extension:ExpandTemplates
Would this ever be core functionality?
In general, how should an extension extend the API, and could this be done for Extension:ExpandTemplates? I think it would be very useful for third party client applications to get programmatic access to the MW parse tree (for convenient high level page manipulation, such as trivially checking for a specific value of a specific field of a specific template and updating that template to add a new field, or counting the length of a list in a specific section, etc., etc.)
I've been trying to implement such a tool in Perl, but of course, my template parser doesn't (yet) fully agree with the MW template parser, and the latter may change in future, requiring me to constantly maintain my Perl parser. Such an API extension would mean I could just get access to to what I need in Perl via the API.
Here is a link to the stuff I've done in Perl in case anyone is interested (constantly changing these days):
https://github.com/dbolser/MediaWiki--/tree/master/local-lib/lib/perl5/Media...
(Note, API.pm isn't my work, and I'll remove it from that location soon).
Cheers, Dan.