Topic on Project:Support desk/Flow

85.168.52.165 (talkcontribs)

Hello,

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

http://trevorappleton.blogspot.fr/2013/04/installing-mediawiki-on-raspberry-pi.html

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?

Thanks

MarkAHershberger (talkcontribs)

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

85.168.52.165 (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.

85.168.52.165 (talkcontribs)

Hello,

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/ http://www.mediawiki.org/xml/export-0.8.xsd" 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?

 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

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

 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"                                                                                                                                         
<?                                                                                                                                                                                             
                                                                                                                                                                                          
$wgExtensionCredits['wikidiff2'][] = array(                                                                                                                                                    
    'name' => 'Wikidiff2',                                                                                                                                                                     
    'version' => '',                                                                                                                                                                           
    'author' => 'Tim Starling',                                                                                                                                                                
    'description' => 'external diff engine for MediaWiki',                                                                                                                                     
    'url' => 'https://www.mediawiki.org/wiki/Extension:Wikidiff2'                                                                                                                              
);                                                                                                                                                                                             
                                                                                                                                                                                               
$wgExternalDiffEngine = 'wikidiff2';      

and only after came the parent xml tag:

<Mediawiki xmlns="http://www.mediawiki.org/xml/export-0.6/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.6/ http://www.medi\
awiki.org/xml/export-0.6.xsd" 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!

195.200.76.252 (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"