我有這樣的XML目前的狀態不是START_ELEMENT
<request>
<accountid>123</accountid>
<accountid>1234</accountid>
</request>
我使用STAX解析器讀取該
XMLEventReader eventReader = inputFactory.createXMLEventReader(reader);
if (startElement.getName().toString().equals("accountid"))
{
item.account = eventReader.getElementText();
}
但我正在逐漸
com.ctc.wstx.exc.WstxParsingException: Current state not START_ELEMENT
at [row,col {unknown-source}]: [2,31]
at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:630)
at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:461)
at com.ctc.wstx.sr.BasicStreamReader.getElementText(BasicStreamReader.java:661)
at com.ctc.wstx.evt.WstxEventReader.getElementText(WstxEventReader.java:118)
at Pavan.main(Pavan.java:49)