Changed behaviour of the XmlImporter to make it more permissive, and allow arrays within mixed elements to be used as candidates for importing to Refine.

This change has also allowed the JsonImporter to pass all its unit tests without any further modification.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@1425 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Iain Sproat 2010-10-04 18:33:59 +00:00
parent ec0581e3a9
commit d977f42f51
2 changed files with 6 additions and 6 deletions

View File

@ -181,11 +181,6 @@ public class XmlImportUtilities extends TreeImportUtilities {
// e.printStackTrace();
}
if (textNodeCount > 0 && childElementNodeCount > 0) {
// This is a mixed element
return null;
}
if (immediateChildCandidateMap.size() > 0) {
List<RecordElementCandidate> immediateChildCandidates = new ArrayList<RecordElementCandidate>(immediateChildCandidateMap.size());
for (Entry<String, Integer> entry : immediateChildCandidateMap.entrySet()) {

View File

@ -84,7 +84,12 @@ public class XmlImporterTests extends RefineTest {
RunTest(getMixedElementSample());
log(project);
assertProjectCreated(project, 0, 0); //nothing imported
assertProjectCreated(project, 4, 6);
Row row = project.rows.get(0);
Assert.assertNotNull(row);
Assert.assertNotNull(row.getCell(2));
Assert.assertEquals(row.getCell(2).value, "Author 1, The");
}
@Test