in internal/pkg/core/deployers/types/sequence.go [70:95]
func (seq *Sequence) Unmarshal(xmlData string, position artifacts.Position) (artifacts.Sequence, error) {
decoder := xml.NewDecoder(strings.NewReader(xmlData))
for {
token, err := decoder.Token()
if err != nil {
return artifacts.Sequence{}, err
}
if startElem, ok := token.(xml.StartElement); ok && startElem.Name.Local == "sequence" {
for _, attr := range startElem.Attr {
switch attr.Name.Local {
case "name":
position := artifacts.Position{LineNo: 1, FileName: position.FileName, Hierarchy: attr.Value}
newSeq, err := seq.unmarshal(decoder, position)
if err != nil {
return artifacts.Sequence{}, err
}
newSeq.Name = attr.Value
return newSeq, nil
}
}
break
}
}
return artifacts.Sequence{}, nil
}