我想使用SyndFeedInput解析非标准提要

<entry>
<title>4 - Fleetmatics Group plc (0001526160) (Issuer)</title>
<link rel="alternate" type="text/html" href="http://www.sec.gov/Archives/edgar/data/1526160/000120919116115415/0001209191-16-115415-index.htm"/>
<summary type="html">
 &lt;b&gt;Filed:&lt;/b&gt; 2016-04-22 &lt;b&gt;AccNo:&lt;/b&gt; 0001209191-16-115415 &lt;b&gt;Size:&lt;/b&gt; 13 KB
</summary>
<updated>2016-04-22T21:07:34-04:00</updated>
<category scheme="http://www.sec.gov/" label="form type" term="4"/>
<id>urn:tag:sec.gov,2008:accession-number=0001209191-16-115415</id>
</entry>


我可以得到titlelinkupdated。但是不知道如何获取summaryterm in category

while (itEntries.hasNext()) {
            SyndEntry entry = (SyndEntry) itEntries.next();
            String title = StringEscapeUtils.unescapeHtml3(entry.getTitle());
            String link = entry.getLink();
            Date datetime = entry.getUpdatedDate();
            //Module summary = entry.getModule("summary");
            System.out.println(title);
            System.out.println(link);
            System.out.println(datetime);

}


请指教!

最佳答案

您可以通过循环entry.getCategories()访问的类别,并且摘要映射到entry.getDescription()

SyndFeed feed = ..
for (SyndEntry entry : feed.getEntries()) {
    for (SyndCategory category : entry.getCategories()) {
        System.out.println(category.getName()); // term
    }

    SyndContent summary = entry.getDescription();
    System.out.println(summary.getValue());
}

关于java - Java SyndFeedInput解析提要,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36828557/

10-10 09:29