stm2 / gwtwiki

Automatically exported from code.google.com/p/gwtwiki
0 stars 0 forks source link

CmContinue Empty for XMLCategoryMembersParser #146

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. List categorymembers
2. Use XMLCategoryMembersParser.getCmContinue()
3. cmcontinue is empty.

What is the expected output? What do you see instead?
Expected: a valid Wikimedia cmcontinue key.
Actual: Empty string

What version of the product are you using? On what operating system?
3.0.19 on Windows and Linux (Ubuntu)

Please provide any additional information below.
Basically the condition on XMLCategoryMembersParser.startElement() is 
insufficient. The XML returns contains 2 sets of "categorymembers" tags: one 
with the attribute "cmcontinue" to indicate a further call is required and a 
set of "cm" tags with data for this call. the condition:

} else if (CATEGORYMEMBERS_TAG.equals(qName)) {
    cmContinue = fAttributes.getValue(CMCONTINUE_ID);
}

should be changed to:

} else if (CATEGORYMEMBERS_TAG.equals(qName) && 
fAttributes.getValue(CMCONTINUE_ID) != null) {
    cmContinue = fAttributes.getValue(CMCONTINUE_ID);
}

alternatively it could be (as there should only be a single continue key 
always):

} else if (CATEGORYMEMBERS_TAG.equals(qName) && fAttributes.getLength() == 0) {
    cmContinue = fAttributes.getValue(CMCONTINUE_ID);
}

Thanks

Original issue reported on code.google.com by xelamitc...@gmail.com on 5 Aug 2013 at 4:49

GoogleCodeExporter commented 8 years ago
The same situation applies to XMLSearchParser.setartElement() and possibly more 
of the parse helper classes.

Original comment by xelamitc...@gmail.com on 5 Aug 2013 at 5:08

GoogleCodeExporter commented 8 years ago
Committed r9122

Original comment by axelclk@gmail.com on 10 Sep 2013 at 9:36