It seems that Xerces 1.4.3 has the "xmlns" attribute declared implicitly. The following document validates, although it shouldn't: <!DOCTYPE foo [ <!ELEMENT foo (#PCDATA)> ]> <foo xmlns="http://www.foo.com"/> Whereas with Crimson and Xerces 2.0, it gives an error like: Error: URI=file:/home/jeff/tmp/java/jdom/src/java/foo.xml Line=4: Attribute "xmlns" must be declared for element type "foo". Here's some code that parses the XML, and silently succeeds with 1.4.3: import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; public class Broken { public static void main(String args[]) throws Exception { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); // The default is false. See http://xml.apache.org/~edwingo/jaxp-faq.html dbf.setValidating(true); DocumentBuilder db = dbf.newDocumentBuilder(); //db.setErrorHandler(new StandardErrorHandler()); Document doc = db.parse(new java.io.File(args.length==0?"foo.xml":args[0])); } } If this is fixed, I hope it's done with big flashing lights, because I'm sure a lot of people *expect* xmlns attributes to have some sort of magic. I've always had the vague notion that reserved names starting with [xX][mM][lL] were ignored by XML parsers. It makes sense to me, because it allows some backwards-compatibility; you can have an XML file with a default namespace that will validate in namespace-unaware XML parsers. But it turns out I'm wrong ;P Thanks, --Jeff
This is the same problem described by bug 1917. By the way, Xerces2-J doesn't have this problem. *** This bug has been marked as a duplicate of 1917 ***