Extension talk:Wiki2xml

Installation
I find this extension very useful, especially the ODT export. I use it via the URL : http://tools.wikimedia.de/~magnus/wiki2xml/w2x.php but it is currently out of service. I tried to install it on my Linux MediaWiki installation, but I didn't managed to activate the ODT export, even after two hours spent to analyze the PHP code... This extension seems to have been made for Windows and doesn't work well with Linux.

Could somebody solve this problem, please ?

Best regards. Peter17 19:53, 6 April 2008 (UTC)


 * It is a bit late to answer. However the correspondig reasme-file provides the following instructions (slightly modified). Put this into your local.php

On a Unix/Linux server the following can be used as a starting point:

# Base url of your site # e.g. "example.com" or "wiki.example.com" $xmlg["site_base_url"] = "" ;

# Directory for temporary files: # subdirectory of the path of your wiki installation $xmlg["temp_dir"] = "/tmp";

# Path to the zip/unzip programs; can be omitted if in default # executable path: #$xmlg["zip_odt_path"] = "";

# Command to zip directory $1 to file $2: $xmlg["zip_odt"] = 'zip -r9 $1 $2';

# Command to unzip file $1 to directory $2: $xmlg["unzip_odt"] = 'unzip -x $1 -d $2'; 
 * It worked for me. Cheers --kgh 22:47, 19 March 2010 (UTC)

Not for Linux?
In the README file of this extension you can read:

On a Unix/Linux server the following can be used as a starting point:

In the local.php file (which can be copied from sample_local.php) you can set the following:


 * 1) On Windows, set
 * 2) $xmlg['is_windows'] = true ;

So my conclusion would be that it is designed to work on linux.

Fix it on Linux - ToDo list
Create new file local.php
 * 1) cp sample_local.php local.php
 * 2) change zip_odt and unzip_odt to the syntax of the zip program installed on the server(It can be: zip/unzip, 7z, etc...(

Fix w2xml.php
 * 1) add line @mkdir($dir)

Fix image converting
 * 1) enable cURL php extension on the server

I need to make this more clear. --Power Boots 16:20, 14 July 2009 (UTC)

Syntax error
In the file "mediawiki_converter.php" (in the extension/wiki2xml/ -directory) on line 45 you find:

$xml .= ' title="' . htmlspecialchars( $title ) '"' ;

When I add a point (".") the extension seems to work. So I changed the line in:

$xml .= ' title="' . htmlspecialchars( $title ) . '"' ;

Hope That Helps

Patch
--rhododendronbusch 14:20, 26 November 2008 (UTC)


 * This fix is now incorporated to the files at subversion. Cheers --kgh 22:47, 19 March 2010 (UTC)