diff --git a/pkg/yqlib/decoder_xml.go b/pkg/yqlib/decoder_xml.go index f50cdeae..e079e384 100644 --- a/pkg/yqlib/decoder_xml.go +++ b/pkg/yqlib/decoder_xml.go @@ -17,7 +17,10 @@ type xmlDecoder struct { } func NewXmlDecoder(reader io.Reader, attributePrefix string, contentPrefix string) Decoder { - return &xmlDecoder{reader: reader, attributePrefix: attributePrefix, contentPrefix: "c", finished: false} + if contentPrefix == "" { + contentPrefix = "content" + } + return &xmlDecoder{reader: reader, attributePrefix: attributePrefix, contentPrefix: contentPrefix, finished: false} } func (dec *xmlDecoder) createSequence(nodes []*xmlNode) (*yaml.Node, error) { diff --git a/pkg/yqlib/stream_evaluator.go b/pkg/yqlib/stream_evaluator.go index 3c9504b7..34192259 100644 --- a/pkg/yqlib/stream_evaluator.go +++ b/pkg/yqlib/stream_evaluator.go @@ -93,7 +93,7 @@ func (s *streamEvaluator) EvaluateFiles(expression string, filenames []string, p func (s *streamEvaluator) Evaluate(filename string, reader io.Reader, node *ExpressionNode, printer Printer, leadingContent string) (uint, error) { var currentIndex uint - decoder := NewXmlDecoder(reader, "+", "c") + decoder := NewXmlDecoder(reader, "+", "") for { var dataBucket yaml.Node errorReading := decoder.Decode(&dataBucket)