Index: test/javax/servlet/TestSchemaValidation.java =================================================================== --- test/javax/servlet/TestSchemaValidation.java (revision 0) +++ test/javax/servlet/TestSchemaValidation.java (revision 0) @@ -0,0 +1,31 @@ +package javax.servlet; + +import java.io.File; +import java.net.URL; +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import junit.framework.Assert; +import org.junit.Test; +import org.w3c.dom.Document; + +public class TestSchemaValidation { + + @Test + public void testValidation() throws Exception { + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + URL url = ServletContext.class.getResource("/javax/servlet/resources/web-app_3_1.xsd"); + System.out.println("url = " + url); + Schema schema = schemaFactory.newSchema(url); + + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + factory.setSchema(schema); + DocumentBuilder builder = factory.newDocumentBuilder(); + Document document = builder.parse(new File("test/webapp/WEB-INF/web.xml")); + Assert.assertEquals("web-app", document.getDocumentElement().getLocalName()); + } +} Index: test/webapp/WEB-INF/web.xml =================================================================== --- test/webapp/WEB-INF/web.xml (revision 1499184) +++ test/webapp/WEB-INF/web.xml (working copy) @@ -43,9 +43,9 @@ Bug49922 + Bug49922Target FORWARD INCLUDE - Bug49922Target Bug49922Forward @@ -98,9 +98,9 @@ - text/plain /bug49nnn/bug49726a.jsp /bug49nnn/bug49726b.jsp + text/plain @@ -129,8 +129,8 @@ Resource for testing bug 53465 bug53465 + java.lang.Integer 10 - java.lang.Integer Bug53465MappedName