Skip to content

Commit

Permalink
Remove multi-line generated XML tags, since ClickHouse fails
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-zaitsev committed Oct 10, 2024
1 parent 7112628 commit 0c63082
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions pkg/xml/xml.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,20 +195,10 @@ func (n *xmlNode) writeTagWithValue(w io.Writer, value string, attributes string
attributes = " remove=\"1\""
value = ""
}
if len(value) < 32 {
// <tag>value</tag>
n.writeTagOpen(w, indent, attributes, noEol)
n.writeValue(w, value)
n.writeTagClose(w, 0, eol)
} else {
// <tag>
// long value NB - printed w/o indent
// </tag>
n.writeTagOpen(w, indent, attributes, eol)
n.writeValue(w, value)
n.writeValue(w, eol)
n.writeTagClose(w, indent, eol)
}
// <tag>value</tag>
n.writeTagOpen(w, indent, attributes, noEol)
n.writeValue(w, value)
n.writeTagClose(w, 0, eol)
}

// writeTagOpen prints open XML tag into io.Writer
Expand Down

0 comments on commit 0c63082

Please sign in to comment.