Lunarpedia:XML Import Format

From Lunarpedia
Jump to: navigation, search

MediaWiki provides an XML based format for porting articles between Wikis. It can also be used for automatically generating and importing articles. This is an attempt to document the format to this end.

This article is a help stub. You can help Lunarpedia by expanding it.




Format

Header

The header identifies the format of the file.

<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.3/ http://www.mediawiki.org/xml/export-0.3.xsd" version="0.3" xml:lang="en">
    <siteinfo>
        <sitename>Lunarpedia</sitename>
    </siteinfo>

Siteinfo includes information about the site. Most of this information is not relevant for automatically generated articles, and it is possible that even <sitename> is of no particular value in this context.


Articles

The article block may be repeated as many times as there ar articles. Note that the size of the resulting file may be an issue on import.

    <page>
        <title>ARTICLE TITLE</title>
        <revision>
            <timestamp>2007-02-09T12:00:00Z</timestamp>            <contributor>
                <username>USER OR SCRIPT NAME</username>
            </contributor>
            <text xml:space="preserve">ARTICLE GOES HERE</text>
        </revision>
    </page>

Note the formatting of the date. If the date field is left out it defaults to 1 January 2001; if it doesn't like the date you entered (for example, if you enter it far into the future) it may default instead to 1 January 1970.


EOF

closing the mediawiki tag ends the file.

</mediawiki>


Characters to Avoid

Here is a table of characters known or suspected to cause errors on importation when included in the article or similar fields.

Character Name Use instead
< less than &lt;
> greater than &gt;
& ampersand &amp;
" less than &quot;
: colon %3A



Article Generating Code


Debugging