continue;
}
Element propertyElem = UtilXml.addChildElement(resourceElem, "property", resourceDocument);
propertyElem.setAttribute("key", StringEscapeUtils.unescapeHtml(labelInfo.getLabelKey()));
if (UtilValidate.isNotEmpty(labelInfo.getLabelKeyComment())) {
Comment labelKeyComment = resourceDocument.createComment(StringEscapeUtils.unescapeHtml(labelInfo.getLabelKeyComment()));
Node parent = propertyElem.getParentNode();
parent.insertBefore(labelKeyComment, propertyElem);
}
for (String localeFound : localesFound) {
LabelValue labelValue = labelInfo.getLabelValue(localeFound);
String valueString = null;
if (labelValue != null) {
valueString = labelValue.getLabelValue();
}
if (UtilValidate.isNotEmpty(valueString)) {
valueString = StringEscapeUtils.unescapeHtml(valueString);
Element valueElem = UtilXml.addChildElementValue(propertyElem, "value", valueString, resourceDocument);
valueElem.setAttribute("xml:lang", localeFound);
if (valueString.trim().length() == 0) {
valueElem.setAttribute("xml:space", "preserve");
}
if (UtilValidate.isNotEmpty(labelValue.getLabelComment())) {
Comment labelComment = resourceDocument.createComment(StringEscapeUtils.unescapeHtml(labelValue.getLabelComment()));
Node parent = valueElem.getParentNode();
parent.insertBefore(labelComment, valueElem);
}
}
}