MotoMusher Active Member Licensed User Longtime User Jan 13, 2014 #1 What's the best way to handle special characters that SaxParser does not recognize? I have the following string being returned to me, and the parser chokes on it. From what I can tell, it is valid XML. I am can't to put a catch block around the saxparser call itself as the lines I need are the ones preceeding this line, and the line after. This particular line is not a necessary part of the document from my end, but I don't have control of that. <messageText>Goeiemôre ons begin nou!</messageText> Error I am getting is: org.apache.harmony.xml.ExpatParser$ParseException: At line 18, column 43: undefined entity Same error with ü Thanks. Last edited: Jan 13, 2014
What's the best way to handle special characters that SaxParser does not recognize? I have the following string being returned to me, and the parser chokes on it. From what I can tell, it is valid XML. I am can't to put a catch block around the saxparser call itself as the lines I need are the ones preceeding this line, and the line after. This particular line is not a necessary part of the document from my end, but I don't have control of that. <messageText>Goeiemôre ons begin nou!</messageText> Error I am getting is: org.apache.harmony.xml.ExpatParser$ParseException: At line 18, column 43: undefined entity Same error with ü Thanks.
NJDude Expert Licensed User Longtime User Jan 13, 2014 #2 Try something like this: Code: Copy ... Dim In As InputStream In = File.OpenInput(File.DirAssets, "myfile.xml") Dim tr As TextReader tr.Initialize2(In, "ISO-8859-1") parser.Parse2(tr, "Parser") In.Close ... Upvote 0
Try something like this: Code: Copy ... Dim In As InputStream In = File.OpenInput(File.DirAssets, "myfile.xml") Dim tr As TextReader tr.Initialize2(In, "ISO-8859-1") parser.Parse2(tr, "Parser") In.Close ...