SyndFeed 中的缺失值

问题描述

我正在编写一个集成来自动提取我的电子记录并将它们记录到数据库中。

我已经完成了几个不同的实现。这是关于罗马的。

现在,我正在尝试使用 SyndFeed 在激活馈送功能后拉下我的电力公司提供的 ATOM 馈送。

    URL FeedUrl = new URL(atomFeedURL);
    SyndFeedInput input = new SyndFeedinput();
    SyndFeed Feed = input.build(new XmlReader(FeedUrl));
    
    for (final Iterator iter = Feed.getModules().iterator(); iter.hasNext();){
        System.out.println("\t" + ((ModuleImpl)iter.next()).getUri());
    }

    System.out.println("Titles of the " + Feed.getEntries().size() + " entries:");
    for (final Iterator iter = Feed.getEntries().iterator(); iter.hasNext();){
         System.out.println("\t" + ((SyndEntry)iter.next()).getContents());
    }

输出

    http://purl.org/dc/elements/1.1/
Titles of the 5 entries:
    [SyndContentImpl.mode=null
SyndContentImpl.type=null
SyndContentImpl.interface=interface com.sun.syndication.Feed.synd.SyndContent
SyndContentImpl.value=
      
    
]
    [SyndContentImpl.mode=null
SyndContentImpl.type=null
SyndContentImpl.interface=interface com.sun.syndication.Feed.synd.SyndContent
SyndContentImpl.value=
      
    
]
    [SyndContentImpl.mode=null
SyndContentImpl.type=null
SyndContentImpl.interface=interface com.sun.syndication.Feed.synd.SyndContent
SyndContentImpl.value=
      
    
]
    [SyndContentImpl.mode=null
SyndContentImpl.type=null
SyndContentImpl.interface=interface com.sun.syndication.Feed.synd.SyndContent
SyndContentImpl.value=
      
    
]
    [SyndContentImpl.mode=null
SyndContentImpl.type=null
SyndContentImpl.interface=interface com.sun.syndication.Feed.synd.SyndContent
SyndContentImpl.value=
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
    
]

问题:

通过这个小测试,我可以拉下提要并对其进行分析。问题是 SydContentImpl.value 不包含 XML 包含的数据。我已经通过下载的 XML 和直接针对提要进行了尝试。

样本 XML 内容的价值:

<IntervalBlock xmlns="http://naesb.org/espi">
    <interval>
      <duration>86400</duration>
      <start>1585713600</start>
    </interval>
    <IntervalReading>
      <timePeriod>
        <duration>3600</duration>
        <start>1585713600</start>
      </timePeriod>
      <value>1180</value>
    </IntervalReading>
    <IntervalReading>
      <timePeriod>
        <duration>3600</duration>
        <start>1585717200</start>
      </timePeriod>
      <value>662</value>
    </IntervalReading>
    <IntervalReading>
      <timePeriod>
        <duration>3600</duration>
        <start>1585720800</start>
      </timePeriod>
      <value>653</value>
    </IntervalReading>
   </IntervalBlock>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...