Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support transformation schema for XML #549

Merged
merged 13 commits into from
Nov 14, 2022
Prev Previous commit
Simplify code for XML transformer
  • Loading branch information
RVRhub committed Nov 13, 2022
commit 904850b298ddeb5dc27679b12e3283c92e89a577
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,12 @@ private void apply(IN input, StringBuilder sb, Field<IN, ?> xmlNode) {
Field<IN, ?>[] attrs = ((CompositeField) xmlNode).getFields();
applyAttributes(input, sb, attrs);

Field<IN, ?> content = Arrays.stream(attrs)
xmlNode = Arrays.stream(attrs)
.filter(inField -> !isAttribute(inField.getName())).findFirst()
.orElse(null);
applyTag(input, sb, content, tag);
} else {
applyTag(input, sb, xmlNode, tag);
}

applyTag(input, sb, xmlNode, tag);
}

private void applyTag(IN input, StringBuilder sb, Field<IN, ?> field, String tag) {
Expand Down