Code example for XMLReader

Methods: parse, setContentHandler

0
			final SAXParserFactory spf = SAXParserFactory.newInstance();
			final SAXParser sp = spf.newSAXParser();
 
			final XMLReader xr = sp.getXMLReader();
			final PXParser pxParser = new PXParser(this.mContext, this.mTextureManager, this.mTextureOptions);
			xr.setContentHandler(pxParser);
 
			xr.parse(new InputSource(new BufferedInputStream(pInputStream)));
 
			return pxParser.getPXSystem();
		} catch (final SAXException e) {
			throw new PXLoadException(e);
		} catch (final ParserConfigurationException pe) {
			/* Doesn't happen. */ 
			return null; 
		} catch (final IOException e) {
			throw new PXLoadException(e);
		} 
	} 
 
	// ===========================================================