definitionElement.setAttribute(CATEGORY_ATTRIBUTE, categoryName);
definitionElement.setAttribute(NAME_ATTRIBUTE, definitionName);
- Element formatElement = doc.createElement(TIME_STAMP_OUTPUT_FORMAT_ELEMENT);
- definitionElement.appendChild(formatElement);
- formatElement.appendChild(doc.createTextNode(timeStampOutputFormat));
+ if (timeStampOutputFormat != null && !timeStampOutputFormat.isEmpty()) {
+ Element formatElement = doc.createElement(TIME_STAMP_OUTPUT_FORMAT_ELEMENT);
+ definitionElement.appendChild(formatElement);
+ formatElement.appendChild(doc.createTextNode(timeStampOutputFormat));
+ }
if (inputs != null) {
for (InputLine inputLine : inputs) {