예제 #1
0
파일: wrapper.go 프로젝트: apognu/xml
func (w *wrapper) ProcessStartElement(el xmlutils.StartElement) (xmlutils.Visitor, xmlutils.ParserError) {
	switch el.Name.Local {
	case "feed":
		w.AtomFeed = atom.NewFeedExt(w.Extensions.Manager)
		w.AtomFeed.Parent = w
		return w.AtomFeed.ProcessStartElement(el)

	case "entry":
		w.AtomEntry = atom.NewEntryExt(w.Extensions.Manager)
		w.AtomEntry.Parent = w
		return w.AtomEntry.ProcessStartElement(el)

	case "channel":
		w.RssChannel = rss.NewChannelExt(w.Extensions.Manager)
		w.RssChannel.Parent = w
		return w.RssChannel.ProcessStartElement(el)
	}

	return w, nil

}
예제 #2
0
func testThrEntryConstructor() xmlutils.Visitor {
	manager := extension.Manager{}
	AddToManager(&manager)

	return atom.NewEntryExt(manager)
}