(p *xpp.XMLPullParser)
| 522 | } |
| 523 | |
| 524 | func (rp *Parser) parseImage(p *xpp.XMLPullParser) (image *Image, err error) { |
| 525 | if err = p.Expect(xpp.StartTag, "image"); err != nil { |
| 526 | return nil, err |
| 527 | } |
| 528 | |
| 529 | image = &Image{} |
| 530 | |
| 531 | for { |
| 532 | tok, err := shared.NextTag(p) |
| 533 | if err != nil { |
| 534 | return image, err |
| 535 | } |
| 536 | |
| 537 | if tok == xpp.EndTag { |
| 538 | break |
| 539 | } |
| 540 | |
| 541 | if tok == xpp.StartTag { |
| 542 | name := strings.ToLower(p.Name) |
| 543 | |
| 544 | if name == "url" { |
| 545 | result, err := shared.ParseText(p) |
| 546 | if err != nil { |
| 547 | return nil, err |
| 548 | } |
| 549 | image.URL = result |
| 550 | } else if name == "title" { |
| 551 | result, err := shared.ParseText(p) |
| 552 | if err != nil { |
| 553 | return nil, err |
| 554 | } |
| 555 | image.Title = result |
| 556 | } else if name == "link" { |
| 557 | result, err := shared.ParseText(p) |
| 558 | if err != nil { |
| 559 | return nil, err |
| 560 | } |
| 561 | image.Link = result |
| 562 | } else if name == "width" { |
| 563 | result, err := shared.ParseText(p) |
| 564 | if err != nil { |
| 565 | return nil, err |
| 566 | } |
| 567 | image.Width = result |
| 568 | } else if name == "height" { |
| 569 | result, err := shared.ParseText(p) |
| 570 | if err != nil { |
| 571 | return nil, err |
| 572 | } |
| 573 | image.Height = result |
| 574 | } else if name == "description" { |
| 575 | result, err := shared.ParseText(p) |
| 576 | if err != nil { |
| 577 | return nil, err |
| 578 | } |
| 579 | image.Description = result |
| 580 | } else { |
| 581 | p.Skip() |
no test coverage detected