Wednesday, May 16, 2012

[android-developers] Re: XML parseing working in android 2.2 but not in android 4.0

Which errors?

On Wednesday, May 16, 2012 6:24:29 AM UTC-4, Bhaumik Thaker wrote:

Hello All,

         i have a problem i have parse the data using DOM parser in android 2.2 but it will not work in higher version of 2.2.
I have use the khop to fetch the response from webservice...

It will write the code as follows...

         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        //factory.setCoalescing(true);
        try{
            //InputStream is = new ByteArrayInputStream(sb.toString().getBytes()); //sb.toString() is the Data which is comes from the webserver as a response
            InputSource instream = new InputSource();
            instream.setEncoding("UTF-8");
            String strnm = sb.toString();
            //instream.setByteStream(new ByteArrayInputStream("<table><uid>250</uid></table>"));
            instream.setCharacterStream(new StringReader(strnm));
            DocumentBuilder db = factory.newDocumentBuilder();
            Document doc = db.parse(instream);
       }

it will throws an error at following.....

Document doc = db.parse(instream);

This will work fine in android 2.2 but not in 2.3 or higher version...



Help me to solve this issue...

Thanks,
--
Bhaumik Thaker

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate