Android XML EntityResolver Create dummyEntityResolver()

Here you can find the source of dummyEntityResolver()

Description

Provide a dummy XML resolver.

Return

the dummy resolver.

Declaration

public static EntityResolver dummyEntityResolver() 

Method Source Code

//package com.java2s;

import java.io.StringReader;

import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;

public class Main {
    /**//from  ww  w .j av a  2s.  co m
     * Provide a dummy XML resolver.
     * 
     * @return the dummy resolver.
     */
    public static EntityResolver dummyEntityResolver() {
        // Thanks to http://www.junlu.com/msg/202604.html
        EntityResolver er = new EntityResolver() {
            public InputSource resolveEntity(String publicId,
                    String systemId) {
                return new InputSource(new StringReader(" "));
            }
        };
        return er;
    }
}