Skip to content

Commit

Permalink
Merge pull request #10058 from QualitativeDataRepository/IQSS/10057-D…
Browse files Browse the repository at this point in the history
…DI_export_bugs

All looks good.
  • Loading branch information
landreev authored Nov 6, 2023
2 parents 8c2be4e + 8b1ab1d commit a8d2e75
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1818,11 +1818,13 @@ private static void createVarDDI(XMLStreamWriter xmlw, JsonObject dvar, String f

// labl
if ((vm == null || !vm.containsKey("label"))) {
xmlw.writeStartElement("labl");
writeAttribute(xmlw, "level", "variable");
xmlw.writeCharacters(dvar.getString("label"));
xmlw.writeEndElement(); //labl
} else if (vm != null && vm.containsKey("label")) {
if(dvar.containsKey("label")) {
xmlw.writeStartElement("labl");
writeAttribute(xmlw, "level", "variable");
xmlw.writeCharacters(dvar.getString("label"));
xmlw.writeEndElement(); //labl
}
} else {
xmlw.writeStartElement("labl");
writeAttribute(xmlw, "level", "variable");
xmlw.writeCharacters(vm.getString("label"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,9 +796,10 @@ private static JsonArrayBuilder jsonCatStat(Collection<VariableCategory> catStat
JsonObjectBuilder catStatObj = Json.createObjectBuilder();
catStatObj.add("label", stat.getLabel())
.add("value", stat.getValue())
.add("isMissing", stat.isMissing())
.add("frequency", stat.getFrequency())
;
.add("isMissing", stat.isMissing());
if(stat.getFrequency()!=null){
catStatObj.add("frequency", stat.getFrequency());
}
catArr.add(catStatObj);
}
return catArr;
Expand Down

0 comments on commit a8d2e75

Please sign in to comment.