0

I am trying to parse an XML file with SAX parser in java but time to time have this exception: SAXParseException; systemId: /input.xml; lineNumber: 627; columnNumber: 5; XML document structures must start and end within the same entity.

I have my custom SAXListener - if you need, I will show a code of it. Some important info:

  1. Xml is valid and is formed well.
  2. Sometimes this error dissapears, although I did not change anything at input xml file.
  3. If xml is quite small and does not reach of 627 line(exception usually appears at the same line of xml), exception does not appear at all.

Xml around 627 line:

<Word Norm="." Form="." POS="17">
<Attribute>17</Attribute>
</Word>
</WordList>
</Sentence>
<Sentence>
<WordList>
<Word Norm="считывать" Form="считывающие" POS="7">
<Attribute>7</Attribute>
<Attribute>20</Attribute>
<Attribute>21</Attribute>
<Attribute>22</Attribute>   <---- this is 627 line of code
<Attribute>23</Attribute>
<Attribute>25</Attribute>
<Attribute>35</Attribute>
<Attribute>37</Attribute>
<Attribute>41</Attribute>
<Attribute>46</Attribute>
</Word>

How I parse file:

MySAXParser mySAXParser = new MySAXParser();
mySAXParser.parseFile(new File("input.xml"));

Thank you for help!

0 Answers0