No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
import java.io.IOException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.xml.sax.InputSource; import org.xml.sax.SAXException; //import com.edankert.SimpleErrorHandler; public abstract class Wellformed extends DocumentBuilder { public static void main(String[] args) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(false); factory.setNamespaceAware(true); DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHandler(new SimpleErrorHandler()); builder.parse(new InputSource("contacts.xml")); } catch (ParserConfigurationException e) { e.printStackTrace(); } … |