Skip to content

Instantly share code, notes, and snippets.

@gclaramunt
Created July 7, 2009 12:37
Show Gist options
  • Save gclaramunt/142051 to your computer and use it in GitHub Desktop.
Save gclaramunt/142051 to your computer and use it in GitHub Desktop.
custom XML parser factory to avoid w3c validation
package workbench;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXNotSupportedException;
import com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl;
public class MyXMLParserFactory extends SAXParserFactoryImpl {
public MyXMLParserFactory() throws SAXNotRecognizedException, SAXNotSupportedException, ParserConfigurationException {
super();
super.setFeature("http://xml.org/sax/features/validation", false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment