How to deal with [xX][mM][lL] in java



So I've got a program that is reading in large XML files, which contain multiple entries of data. So the database I'm using it for originally contained 40,000 separate entries written in XML file, but you can download one XML file that contains all the entries. However, because of this, the XML declaration element:-



<?xml version="1.0" encoding="UTF-8"?>


is called multiple times throughout the document, and I was wondering whether there was some way of dealing with this through the use of StAX parser.


Edit: should of said that I can't properly parse through my document and read everything as it keeps returning the error:-



Exception in thread "main" javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1062,6]
Message: The processing instruction target matching "[xX][mM][lL]" is not allowed.


because of the fact that the xml declaration is stated multiple times. Thanks


No comments:

Post a Comment