Topic on Project:Support desk (talkcontribs)


I've setup mediawiki on my rasberry pi using the following tutorial:

It is now running but I'm getting a hard time trying to import articles from wikipedia (using special:import in the url).

When uploading an xml through the interface it fails and displays the following message:

"Import failed: Expected <mediawiki> tag, got "

Any ideas?


MarkAHershberger (talkcontribs)

How are you importing the dump? Are you trying to upload the .7z file to Special:Import? (talkcontribs)
MarkAHershberger (talkcontribs)

Perhaps there is some error you are hitting. Try adding

 error_reporting( -1 );
 ini_set( 'display_errors', 1 );

to your LocalSettings.php and repeat the upload. (talkcontribs)


Thanks for your answer, i'm still unable to import (after putting the values in the localsettings)

I still have the :

Import failed: Expected <mediawiki> tag, got "

Plus these errors :

Warning: XMLReader::read(): uploadsource://9d693349ea37d3f06a7bc7aba16c521a:1: namespace error : Namespace prefix xsi for schemaLocation on mediawiki is not defined in /usr/share/mediawiki/includes/Import.php on line 404

Warning: XMLReader::read(): rt-0.8/" version="0.8" xml:lang="en" in /usr/share/mediawiki/includes/Import.php on line 404

Warning: XMLReader::read(): ^ in /usr/share/mediawiki/includes/Import.php on line 404

Warning: XMLReader::read(): An Error Occured while reading in /usr/share/mediawiki/includes/Import.php on line 404

Thanks in advance

MarkAHershberger (talkcontribs)

Interesting. The clue here is

 Namespace prefix xsi for schemaLocation on mediawiki is not defined

Does the first line of your xml dump file contain the following bit?


What version of php are you running? What OS?

If the "xmlns:xsi" bit is missing, where did you get the file?

2001:981:8965:1:224:D7FF:FE6C:2AB0 (talkcontribs)

Let me jump in on this one since I had the same problem and found a (rather simple) solution for it.

At the very top of my dump.xml file, for some reason, there was the following snippet

$wgExtensionCredits['wikidiff2'][] = array(                                                                                                                                                    
    'name' => 'Wikidiff2',                                                                                                                                                                     
    'version' => '',                                                                                                                                                                           
    'author' => 'Tim Starling',                                                                                                                                                                
    'description' => 'external diff engine for MediaWiki',                                                                                                                                     
    'url' => ''                                                                                                                              
$wgExternalDiffEngine = 'wikidiff2';      

and only after came the parent xml tag:

<Mediawiki xmlns="" xmlns:xsi="" xsi:schemaLocation=" http://www.medi\" version="0.6" xml:lang="en"> 

So what i did was just remove everything the was before that parent tag, and it imported without a problem.

hope it helps. a

Ciencia Al Poder (talkcontribs)

That's really weird. Your problem resides in the Extension:Wikidiff2 on your installation, because it uses short PHP tags (<? instead of <?php).

But if it's appearing on your dumps, it should be appearing also on your wiki pages! (talkcontribs)

Could be a character encoding issue with your source XML file, or related to how your server is uploading the file contents. Try to be sure the content is UTF-8 and see if that helps.

Worked for us with this issue; your problem might be different.

Reply to "importation problem"