Exemple #1
0
// Iterate emits Converter elements via XML decoding.
func (s Genios) Iterate(r io.Reader) (<-chan []span.Importer, error) {
	return span.FromXML(r, "Document", func(d *xml.Decoder, se xml.StartElement) (span.Importer, error) {
		doc := new(Document)
		err := d.DecodeElement(&doc, &se)
		return doc, err
	})
}
Exemple #2
0
// Iterate. Most data is in a single XML file.
func (s IEEE) Iterate(r io.Reader) (<-chan []span.Importer, error) {
	return span.FromXML(r, "publication", func(d *xml.Decoder, se xml.StartElement) (span.Importer, error) {
		p := new(Publication)
		err := d.DecodeElement(&p, &se)
		return p, err
	})
}
Exemple #3
0
// Iterate emits Converter elements via XML decoding.
func (s DeGruyter) Iterate(r io.Reader) (<-chan []span.Importer, error) {
	return span.FromXML(r, "article", func(d *xml.Decoder, se xml.StartElement) (span.Importer, error) {
		article := new(Article)
		err := d.DecodeElement(&article, &se)
		return article, err
	})
}
Exemple #4
0
// Iterate emits Converter elements via XML decoding.
func (s DublinCore) Iterate(r io.Reader) (<-chan []span.Importer, error) {
	return span.FromXML(r, "Record", func(d *xml.Decoder, se xml.StartElement) (span.Importer, error) {
		doc := new(Record)
		err := d.DecodeElement(&doc, &se)
		return doc, err
	})
}
Exemple #5
0
// Iterate emits Converter elements via XML decoding.
func (s Thieme) Iterate(r io.Reader) (<-chan []span.Importer, error) {
	switch s.Format {
	default:
		return span.FromXML(r, "Article", func(d *xml.Decoder, se xml.StartElement) (span.Importer, error) {
			doc := new(Document)
			err := d.DecodeElement(&doc, &se)
			return doc, err
		})
	case "nlm":
		return span.FromXML(r, "article", func(d *xml.Decoder, se xml.StartElement) (span.Importer, error) {
			doc := new(Article)
			err := d.DecodeElement(&doc, &se)
			return doc, err
		})
	}
}