As far as I remember xmlreader can use alternative mechanisms of XML parsing: cElementTree, ElementTree, regexp. The version of the cElementTree depends on the Python version. My bet it is a regexp method fault. Or maybe cElementTree fault [IMHO this library have never been up to the standard].<br>
<br>-- Dmitry<br><br><br><div class="gmail_quote">On Tue, Oct 5, 2010 at 2:35 PM, Russell Blau <span dir="ltr"><<a href="mailto:russblau@hotmail.com">russblau@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
"emijrp" <<a href="mailto:emijrp@gmail.com">emijrp@gmail.com</a>> wrote in message<br>
news:AANLkTimu0+xJMBU1f48z8di9deBS_4_gmC_gOB6t82iJ@mail.gmail.com...<br>
<div class="im"><br>
> I think that there is an error in xmlreader.py. When parsing a full<br>
> revision XML (in this case[1]), using this code[2] (look at the<br>
> try-catch, it writes when fails) I get correctly username,<br>
> timestamp and revisionid, but sometimes, the page title and the page<br>
> id are None or empty string.<br>
<br>
</div><div class="im">> [1]<br>
> <a href="http://download.wikimedia.org/kwwiki/20100926/kwwiki-20100926-pages-meta-history.xml.7z" target="_blank">http://download.wikimedia.org/kwwiki/20100926/kwwiki-20100926-pages-meta-history.xml.7z</a><br>
> [2] <a href="http://pastebin.ca/1951930" target="_blank">http://pastebin.ca/1951930</a><br>
> [3] <a href="http://pastebin.ca/1951937" target="_blank">http://pastebin.ca/1951937</a><br>
<br>
</div>I have been completely unable to replicate this supposed error. I<br>
downloaded the same kwwiki dump file that you referenced. I loaded it with<br>
xmlreader.XmlDump, ran it through the parser, and counted the number of<br>
XMLEntry objects it generated: 4711. Then as a test I opened the same dump<br>
as a text file and counted the number of lines that contain the string<br>
"<page>": 4711. So the parser is correctly returning one object per page<br>
item found in the file.<br>
<br>
Next I ran the parser again with a script that would print out a message if<br>
any XMLEntry object had a missing title (None or empty string); no messages.<br>
<br>
Then I searched for the specific page entry you showed in your pastebin item<br>
[3]. The result of this test is shown at [4]. In short, it found exactly the<br>
page title you said was missing.<br>
<br>
I cannot explain why your results are different than mine, unless perhaps<br>
you have a corrupted copy of the dump file, or are not using the current<br>
version of xmlreader.py.<br>
<br>
Russ<br>
<br>
[4] <a href="http://pastebin.ca/1955170" target="_blank">http://pastebin.ca/1955170</a><br>
<div><div></div><div class="h5"><br>
<br>
<br>
<br>
_______________________________________________<br>
Pywikipedia-l mailing list<br>
<a href="mailto:Pywikipedia-l@lists.wikimedia.org">Pywikipedia-l@lists.wikimedia.org</a><br>
<a href="https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l" target="_blank">https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l</a><br>
</div></div></blockquote></div><br>