func NewParserBuff(bundleConfigStream []byte, s BundleStrategy) (*Parser, error) { if s == nil { return nil, utils.FormatError(errors.New("bundle strategy is nil")) } data, err := utils.ParseXMLBuff(bundleConfigStream, s) if err != nil { return nil, utils.FormatError(err) } return &Parser{s, data}, nil }
// ParseXMLInputBuf is responsible for parsing a given stream of bytes // representing appropriate input data to a srtuctured form func ParseXMLInputBuf(data []byte) (*XMLInputData, error) { d, err := utils.ParseXMLBuff(data, new(XMLInputData)) if err != nil { return nil, utils.FormatError(err) } if err := verify(d.(*XMLInputData)); err != nil { return nil, utils.FormatError(err) } return d.(*XMLInputData), nil }