While parsing an XML using Stax I encountered this error.
Even though the data was inside CDATA tags it was still giving this error which was puzzling. On further analysis I found out that Control Characters (^M) was causing this problem.
To fix it in Unix/Linux, just remove control characters and I found this nifty command to do it:
tr -d "\r" < inputfile > outputfile
Even though the data was inside CDATA tags it was still giving this error which was puzzling. On further analysis I found out that Control Characters (^M) was causing this problem.
To fix it in Unix/Linux, just remove control characters and I found this nifty command to do it:
tr -d "\r" < inputfile > outputfile