mediawiki-xml2sql icon indicating copy to clipboard operation
mediawiki-xml2sql copied to clipboard

Missing element definition for "<redirect>"

Open wwentland opened this issue 15 years ago • 3 comments

xml2sql fail with recent WP dumps due to missing element definition for "redirect".

$ xml2sql swwiki-20090821-pages-articles.xml 
unexpected element <redirect>
xml2sql: parsing aborted at line 209 pos 16.

This issue can be solved by adding a definition for redirect to keywords:

--- a/keywords
+++ b/keywords
@@ -20,6 +20,7 @@ enum element {
   el_minor,
   el_comment,
   el_text,
+  el_redirect,
 };
 %}

and re-run gperf as explained in mediawiki.c.

babilen

wwentland avatar Aug 28 '09 14:08 wwentland

after applying that patch make fails. I've slightly modified it and now it compiles. This is the patch:

--- a/keywords
+++ b/keywords
@@ -20,6 +20,7 @@
   el_minor,
   el_comment,
   el_text,
+  el_redirect,
 };
 %}
 struct eltmap { char *name; enum element t; };
@@ -44,3 +45,4 @@
 minor,        el_minor
 comment,      el_comment
 text,         el_text
+redirect,     el_redirect

antot avatar Feb 22 '10 12:02 antot

i can confirm that adding el_redirect and redirect, el_redirect fixes the issue. just remove mediawiki.c and re-run make to regenerate it with gperf. could you please do so and submit that fix?

josch avatar Jul 21 '10 23:07 josch

I have made a fix in pull request #5

modsaid avatar Aug 23 '13 21:08 modsaid