Java tutorial
//package com.java2s; /******************************************************************************* * Copyright (c) 2005-2012 eBay Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * *******************************************************************************/ import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.XMLReaderFactory; public class Main { static final String DEFAULT_PARSER_NAME = "org.apache.xerces.parsers.SAXParser"; /** This will create an XML read that will set the parser parameters that * are necessary for parsing an email XML. It will also set which schema * to validate against. */ public static XMLReader createXmlReader() throws SAXException { final XMLReader xmlReader = XMLReaderFactory.createXMLReader(DEFAULT_PARSER_NAME); return xmlReader; } }