Skip to content

Commit

Permalink
demonstrate difficulty validating DD 2.5 #3648
Browse files Browse the repository at this point in the history
The DDI 2.5 test fails with this:

`src-resolve: Cannot resolve the name 'xml:lang' to a(n) 'attribute declaration' component.`

We should be exporting valid DDI 2.5.
  • Loading branch information
pdurbin committed Mar 7, 2017
1 parent 603bd0c commit a491cd9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<codeBook xmlns="http://www.icpsr.umich.edu/DDI" version="2.0">
<stdyDscr>
<citation>
<titlStmt>
<titl>Darwin's Finches</titl>
<IDNo agency="doi">10.5072/FK2/PCA2E3</IDNo>
</titlStmt>
<rspStmt>
<AuthEnty>Finch, Fiona</AuthEnty>
</rspStmt>
<biblCit>Finch, Fiona, 2015, "Darwin's Finches", http://dx.doi.org/10.5072/FK2/PCA2E3, Root Dataverse, V1</biblCit>
</citation>
</stdyDscr>
</codeBook>
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,17 @@ public class XmlValidatorTest {
@Test
public void testValidateXml() throws IOException, SAXException {
String dir = "src/test/java/edu/harvard/iq/dataverse/export/ddi/";
//String codebookdir = "http://www.ddialliance.org/Specification/DDI-Codebook/2.5/XMLSchema/";
// assertEquals(true, XmlValidator.validateXml(dir + "dataset-finch1.xml", dir + "codebook.xsd"));
// assertEquals(true, XmlValidator.validateXml(dir + "dataset-spruce1.xml", dir + "codebook.xsd"));

System.out.println("Attempting to validate a DDI 2.0 file...");
assertEquals(true, XmlValidator.validateXml(dir + "dataset-finch1-ddi-2.0.xml", dir + "Version2-0.xsd"));

System.out.println("Attempting to validate a DDI 2.5 file...");
// codebook.xsd comes from http://www.ddialliance.org/Specification/DDI-Codebook/2.5/XMLSchema/codebook.xsd
/**
* @todo Make the DDI 2.5 format we export pass validation. See
* https://github.com/IQSS/dataverse/issues/3648
*/
assertEquals(true, XmlValidator.validateXml(dir + "dataset-finch1.xml", dir + "codebook.xsd"));
}

}

0 comments on commit a491cd9

Please sign in to comment.