Code example for XMLReader

Methods: setEntityResolver

0
                    return new InputSource(new ByteArrayInputStream(XML_PREAMBLE.getBytes()));
                else 
                    return null; 
            } 
        }; 
        xmlReader.setEntityResolver(entityResolver);
        return xmlReader;
    } 
 
    public static PoiList unmarshal(Reader reader) throws JAXBException {
        PoiList result = null;
        try { 
            result = (PoiList) newUnmarshaller().unmarshal(new SAXSource(createXMLReader(), new InputSource(reader)));
        } catch (ClassCastException e) {
            throw new JAXBException("Parse error with " + result + ": " + e.getMessage());
        } 
        return result;
    } 
 
    public static void marshal(PoiList poiList, OutputStream fos) throws JAXBException {
        try {