This commit is contained in:
Mike Farah 2021-12-16 22:20:37 +11:00
parent 4571ec825f
commit dbe3921f5d
2 changed files with 5 additions and 2 deletions

View File

@ -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) {

View File

@ -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)