Code example for InputSource

Methods: setCharacterStream

            final SAXParserFactory factory = SAXParserFactory.newInstance();
            try { 
                final SAXParser sp = factory.newSAXParser();
                final XMLReader xr = sp.getXMLReader();
                final InputSource is = new InputSource();
                is.setCharacterStream(new StringReader(xml));
                //we set the SAX DefaultHandler 
                xr.setContentHandler((DefaultHandler) mHandler);
                Out.v(TAG, "start parsing SAX");
                Out.v(TAG, "end parsing SAX");
            } catch (final Exception e) {
                throw new ParseException("Parsing error");
Stop searching for code, let great code find you!  Add Codota to your java IDE