Created
July 7, 2009 12:37
-
-
Save gclaramunt/142051 to your computer and use it in GitHub Desktop.
custom XML parser factory to avoid w3c validation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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