java - Parsing xml with StAX: not getting a large content tag -
i using stax parse xml file, problem when tag content large, stax not able give me whole content. here part of xml doc, content of payload tag more larger, can't print in sof:
<payload>{\"id\": \"entity24\",\"attr1\": {\"type\": \"sensor\",\"type\": \"type1\",\"value\": \"val1\",\"metadata\": {}}}</payload>
here part of code parsing it:
if(startelement.getname().getlocalpart().equals("payload")){ xmlevent = xmleventreader.nextevent(); if(xmlevent.ischaracters()){ setpayload(xmlevent.ascharacters().getdata()); } }
any idea why stax not able give whole tag content? , best regards.
you should either concatenate ischaracters
events between other events or set is_coalescing property.
just sax, stax may offer 1 single run of characters multiple events.
Comments
Post a Comment