Re: [android-developers] Re: Help needed with parsing some XML data !

2010-02-13 Thread Thierry Legras
Hi, I have a similar problem. I am parsing iso-8859-1 html page with a sax parser but having trouble to display it on _some_ devices (characters é è ... are replaced by random symbols). On some devide i have to use myString.getBytes(iso-8859-1) to display it correctly, and on some other devices,

[android-developers] Re: Help needed with parsing some XML data !

2010-02-04 Thread MobDev
hehe, my bad I said Netbeans but I actually use Eclipse :P Still used to J2ME with NetBeans thats why I mixed up... Anyways, I do get the error (exception) which I already posted in one of my first posts : At line 40, column 23: not well-formed (invalid token) They *MUST* be valid printing

Re: [android-developers] Re: Help needed with parsing some XML data !

2010-02-04 Thread Frank Weiss
I have two ideas for you, Mobdev: 1) Google for not well-formed (invalid token) and see what other people have found regarding this error. 2) Go to validator.w3.org and see if the XML file in question is indeed valid or not. Please let us know what you find out. -- You received this message

[android-developers] Re: Help needed with parsing some XML data !

2010-02-04 Thread MobDev
Well, to be honest your first idea was also mine :P So I already looked via Google but to be honest I haven't found that many clear discussions/ explanations... I also tried idea 2 and this is what I got : Congratulations The document located at http://x was successfully checked as

[android-developers] Re: Help needed with parsing some XML data !

2010-02-04 Thread Bob Kerns
The problem is, I can't reproduce your problem. I don't know why you don't know how to see a stack trace in Eclipse, so I'm not quite sure how to tell you how. :=) * You should be in the Debug perspective. * Select the Breakpoints view in the Debug perspective. * Click on the little exclamation

[android-developers] Re: Help needed with parsing some XML data !

2010-02-03 Thread MobDev
Actually this is the code for the second approach : /* Create a URL we want to load some xml-data from. */ URL url = new URL(http://www.myserver.com/xmlstream;); /* Get a SAXParser from the SAXPArserFactory. */ SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp =

[android-developers] Re: Help needed with parsing some XML data !

2010-02-03 Thread MobDev
Btw I also have tried this instead : try { URL url = new URL(http://www.myserver.com/xmlstream;); URLConnection conn = url.openConnection(); InputStream is = conn.getInputStream(); Xml.parse(is, Xml.Encoding.ISO_8859_1, new ExampleHandler

[android-developers] Re: Help needed with parsing some XML data !

2010-02-03 Thread Bob Kerns
Well, you found one way to get the encoding in there. A few more: InputSource.setEncoding(iso-8859-1) new InputStreamReader(stream, iso-8859-1); I'd argue that it should have gotten it from the ?xml... encoding=iso-8859-1? -- I'm a bit surprised it didn't. But it's something I'd never rely on if

[android-developers] Re: Help needed with parsing some XML data !

2010-02-03 Thread MobDev
well to begin with : thx for the expalanation :D I was wondering about your statement : Try logging to a file. Or better yet, create test cases, and verify the correct operation of your code via test suite, rather than via log statements. I already tried in a test case, which was to write the

[android-developers] Re: Help needed with parsing some XML data !

2010-02-03 Thread MobDev
well to begin with : thx for the expalanation :D I was wondering about your statement : Try logging to a file. Or better yet, create test cases, and verify the correct operation of your code via test suite, rather than via log statements. I already tried in a test case, which was to write the

[android-developers] Re: Help needed with parsing some XML data !

2010-02-03 Thread MobDev
well to begin with : thx for the expalanation :D I was wondering about your statement : Try logging to a file. Or better yet, create test cases, and verify the correct operation of your code via test suite, rather than via log statements. I already tried in a test case, which was to write the

Re: [android-developers] Re: Help needed with parsing some XML data !

2010-02-03 Thread Frank Weiss
Found attribute : Albanië instead of Albanié This suggests you are displaying UTF-8 text (which is was logcat does) as Latin-1. To wit: ë = 0xC3 0xAB which are UTF-8 for Latin1 0xEB. However, é is 0xEB, not 0xAB, so there's something else afoot. Also note that when you see the rectangle with

[android-developers] Re: Help needed with parsing some XML data !

2010-02-03 Thread Bob Kerns
Yeah, that's not what I mean by a test case. See http://junit.org as a starting point. (The Android SDK includes some limited version of JUnit I don't recognize. It's adequate for this purpose, but the full, modern version is better. For non-device testing, you're not restricted to the supplied

[android-developers] Re: Help needed with parsing some XML data !

2010-02-02 Thread Bob Kerns
While I would expect your second approach to work, it's important to note that IT IS NOT REQUIRED TO WORK. The XML standard does not require XML processors to support anything other than UTF-8 or UTF-16. In this day and age, I would STRONGLY discourage use of anything other than UTF-8, or,