Skip to content

Commit b98b1dd

Browse files
committed
Add support for 3.3 and new custom dictionary terms
1 parent 7e2eafd commit b98b1dd

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Colectica.DDISchemaCheck.Checks/CustomWords.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ lifecycle
1414
IDs
1515

1616
dpi
17+
substage
1718
inline
1819
locator
1920
codelist
@@ -25,6 +26,8 @@ randomizable
2526
anonymized
2627
geo
2728
geo-referenced
29+
pre
30+
pre-election
2831
Georeferenced
2932
xmin
3033
xmax

Colectica.DDISchemaCheck.Checks/DetectSchemaType.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public static bool GetTestResult(string filename, out string content)
1919
string formatVersion = string.Empty;
2020
if (format == DdiFileFormat.Ddi31) { formatVersion = "3.1"; }
2121
else if (format == DdiFileFormat.Ddi32) { formatVersion = "3.2"; }
22+
else if (format == DdiFileFormat.Ddi33) { formatVersion = "3.3"; }
2223
b.Append(string.Format("<div class=\"alert alert-success\"></span>Detected DDI Schema for Lifecycle version {0}</div>", formatVersion));
2324
return true;
2425
}
@@ -62,6 +63,10 @@ public static DdiFileFormat GetSchemaFileFormat(string filename)
6263
{
6364
return DdiFileFormat.Ddi31;
6465
}
66+
else if (string.Compare(attribute, "ddi:instance:3_3", true) == 0)
67+
{
68+
return DdiFileFormat.Ddi33;
69+
}
6570
throw new InvalidOperationException("The schema file is using an unknown namespace.");
6671
}
6772
throw new InvalidOperationException("The .xsd file was empty.");
@@ -81,6 +86,7 @@ public enum DdiFileFormat
8186
Ddi25 = 1,
8287
Ddi31 = 2,
8388
Ddi32 = 4,
89+
Ddi33 = 5,
8490
}
8591

8692
}

Colectica.DDISchemaCheck.Checks/ValidateSchema.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,13 @@ public XmlSchemaSet GetSchema(string filename)
9797
settings.DtdProcessing = DtdProcessing.Parse;
9898

9999
// since there is a DTD entity in reusable, This is the only way I can get it to resolve
100+
/*
100101
string reusable = Path.GetDirectoryName(filename) + Path.DirectorySeparatorChar +"reusable.xsd";
101102
using (XmlReader reader = XmlReader.Create(reusable, settings))
102103
{
103104
XmlSchema xmlSchema = XmlSchema.Read(reader, new ValidationEventHandler(ValidationCallback));
104105
xmlSchemaSet.Add(xmlSchema);
105-
}
106+
}*/
106107

107108
using (XmlReader reader = XmlReader.Create(filename, settings))
108109
{

0 commit comments

Comments
 (0)