<property>
<name>alert.scheduler.Scheduler</name>
<value>
alert.control.HostAliveTask#repeat#100;
alert.control.WebpageRespTask#repeat#180;
alert.control.AlarmNumTask#daily#16:45:00
</value>
</property>
发现读取出的数据只有前面两行
解决的办法是设置javax.xml.stream.isCoalescing为true
inputFactory.setProperty("javax.xml.stream.isCoalescing", true);
XMLSteamReader的next()方法可能将连续的字符数据作为一个块返回,也可能分成好几个块。如果isCoalescing设置为true,则内容将合并,只返回一个块。
参考:
http://ramp-tech.blogspot.com/2011/05/be-careful-using-stax-parser.html 在这找到了同样的问题
http://docs.oracle.com/javase/6/docs/api/javax/xml/stream/XMLStreamReader.html 关于isCoalescing的解释