我的 XML 數(shù)據(jù):<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:idx="urn:atom-extension:indexing"> <entry> <title type="html">Some Title</title> <link href="https://www.google.com"></link> </entry></feed>我想<entry>用它的<title>&<link>標(biāo)簽解析 Each到目前為止我已經(jīng)成功解析了標(biāo)題但沒有成功解析<link>.我的代碼:type Entry struct { XMLName xml.Name `xml:"entry"` Link string `xml:"link"` Title string `xml:"title"`}type Feed struct { XMLName xml.Name `xml:"feed"` Entries []Entry `xml:"entry"`}func (s Entry) String() string { return fmt.Sprintf("\t Link : %s - Title : %s \n", s.Link, s.Title)}現(xiàn)場演示http://play.golang.org/p/hteQ5RuMco
Golang Google 警報 XML 解析
慕桂英3389331
2021-09-20 10:06:56