Re: XML parsing error?
Prunka, Sean <PRUNKAS <at> battelle.org>
2009-12-16 15:22:59 GMT
Thanks. The last bit is the one I'm hitting already. We have a Java Programmer that uses require_once in
every file that calls the other files, so it's a nice tangled mess, but I am sorting it all out. I think I've
gotten narrowed done to a handful of possible culprits.
I'm expecting to find an extra line after a closing tag... but I had forgotten to check for leading
whitespace. Thanks again!
-----Original Message-----
From: mediawiki-api-bounces <at> lists.wikimedia.org
[mailto:mediawiki-api-bounces <at> lists.wikimedia.org] On Behalf Of Roan Kattouw
Sent: Wednesday, December 16, 2009 10:10 AM
To: MediaWiki API announcements & discussion
Subject: Re: [Mediawiki-api] XML parsing error?
2009/12/16 Prunka, Sean <PRUNKAS <at> battelle.org>:
> Hey all, I hope someone can point me in the right direction:
>
> I'm fairly sure this is caused by an extension we've written, but I don't know where to look.
>
> We are using MW 1.13.2 and are not able to upgrade at this time.
> We work on a closed system, and have written *many* extensions and hooks to our wiki.
> We have only two extensions to the API. There is no extra whitespace or output from the API extensions. (I
comment out the include and the $wgAPIModules['function'] lines for both of them, call the API and still
get the error. I tried calling the live wikipdeia api and do not get this error. So the bug is very likely our
own, but I don't know where to look.
>
>
> I get the following error when I call the API (any action)
>
> XML Parsing Error: XML or text declaration not at start of entity
> Location: http://localhost/path/to/wiki/api.php?action=actionx
> Line Number 2, Column 1:
>
> Where else should I look for the output/whitespace?
>
The whitespace could be in any file, anywhere (although it's very
likely not in MW core). Look through your extension files (including
third-party extensions) and:
* Kill leading whitespace before first <?php
* Remove the ?> tag at the end, it's unnecessary
* Carefully inspect inline HTML between ?> and <?php , if any, and
convince yourself it's conditional
You could also try disabling extensions (by commenting out the
require_once line in LocalSettings.php) one by one until you find the
guilty one.
Roan Kattouw (Catrope)
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api