I've installed XPath/Feeds/D7, but I don't know how to configure XPath parser settings.

Maybe someone can help me to set it right.

I just want to inject <title> and <text xml:space="preserve"> to my node.

I need help to configure my XPath Parser settings : admin/structure/feeds/edit/my_import/settings/FeedsXPathParserXML

I've the following XML structure :

<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="fr">
    <sitename>Site Name</sitename>
    <generator>MediaWiki 1.15.5-1~bpo50+1</generator>
      <namespace key="-2">Media</namespace>
      <namespace key="-1">Special</namespace>
      <namespace key="0" />
      <namespace key="1">Chat</namespace>
      <namespace key="2">user</namespace>
      <namespace key="3">Chat user</namespace>
      <namespace key="4">domain.net</namespace>
      <namespace key="5">Chat domain.net</namespace>
      <namespace key="6">files</namespace>
      <namespace key="7">Chat files</namespace>
      <namespace key="8">MediaWiki</namespace>
      <namespace key="9">Chat MediaWiki</namespace>
      <namespace key="10">Model</namespace>
      <namespace key="11">Chat model</namespace>
      <namespace key="12">help</namespace>
      <namespace key="13">Chat help</namespace>
      <namespace key="14">category</namespace>
      <namespace key="15">Chat category</namespace>
      <comment>/* Install Drupal with Drush */</comment>
      <text xml:space="preserve">Drush is a command line utility.

=Install Drupal with Drush=
To install drupal with drush :
 drush site-install standard --db-url=mysql://username:pass@localhost/databasename

      <comment>Do it under Debian</comment>
      <text xml:space="preserve">=Install=
===Memcache Server===
To install :
 aptitude install memcached

Read and change ''/etc/memcached.conf''.
===PHP5 / PECL===
Install memcache PECL :
 pecl install memcache

Restart Apache.

* InstallMemcache module in Drupal.
* Change ''settings.php'' :
&lt;source lang=&quot;php&quot;&gt;
$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['memcache_key_prefix'] = 'site_prefix';

Read : http://drupal.org/node/1131458



Optional task : How can I convert "=" to <h1>, "==" to <h2>, space before start of line to <pre>, [[category:xyz]] to Tags, etc ... ?

  • While I understand that you are doing this within the context of a Drupal module, your question is really about XPath, and has nothing to do with Drupal. I call off-topic. Your "optional task" however, should be opened as a separate question. I could actually write up something on that myself. I'll try and find the time for that later. :)
    – Letharion
    May 29, 2012 at 8:30
  • I don't completely agree, as the Feeds module has its own logic on top of XPath, so perhaps it's borderline, but maybe not OT. As for the optional task, Feeds Tamper could probably be of use.
    – Countzero
    May 29, 2012 at 10:03
  • @Countzero : Thank you, I'll gonna test Feeds Tamper.
    – user117283
    Jun 1, 2012 at 20:21

1 Answer 1


Context should be : //Mediawiki/page, Title field should be title and Text should be revision/text.

  • It work great, thank you !! I think it can help everyone who want to import XML content to Drupal.
    – user117283
    Jun 1, 2012 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.