Пример #1
0
func newTotalElement() extension.Element {
	t := atom.NewBasicElement(nil)

	t.Content = xmlutils.NewElement("total", "", atom.IsValidLength)

	return t
}
Пример #2
0
func NewTestThrEntry(links []*atom.Link, total, href, ref, typ, source string) *atom.Entry {
	e := atom.NewEntry()

	if href != "" || ref != "" || typ != "" || source != "" {
		inreplyto := newInReplyTo()
		inreplyto.Href.Value = href
		inreplyto.Ref.Value = ref
		inreplyto.Type.Value = typ
		inreplyto.Source.Value = source
		e.Extension.Store.Add(_inreplyto, inreplyto)
	}

	if total != "" {
		t := atom.NewBasicElement(nil)
		t.Content.Value = total
		e.Extension.Store.Add(_total, t)
	}

	e.Links = links

	return e
}