Skip to content

Commit

Permalink
Empty properties causing extra indents in XmlHandler
Browse files Browse the repository at this point in the history
Minor fix to move down the code that increments the indent level in XmlHandler.showProperty - when Utils.isPropertyEmpty is true, it indents unnecessarily causing misalignment in the XML.
  • Loading branch information
karenhanson committed Nov 28, 2023
1 parent d745990 commit 2fb1cb3
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -744,18 +744,18 @@ protected String valueToString(Object obj) {
}

protected void showProperty(Property property) {
String margin = getIndent(++_level);
String margn2 = margin + " ";
String margn3 = margn2 + " ";
String margn4 = margn3 + " ";

PropertyArity arity = property.getArity();
PropertyType type = property.getType();

// If the property would generate an empty element, don't output it,
// as this could result in a schema violation.
if (Utils.isPropertyEmpty(property, arity))
return;

String margin = getIndent(++_level);
String margn2 = margin + " ";
String margn3 = margn2 + " ";
String margn4 = margn3 + " ";

boolean valueIsProperty = PropertyType.PROPERTY.equals(type);
boolean valueIsNiso = PropertyType.NISOIMAGEMETADATA.equals(type);
Expand Down

0 comments on commit 2fb1cb3

Please sign in to comment.