External referenced DTD in XML

You have duplicate DOCTYPE declarations. If you want to reference an external DTD: test.xml <?xml version=’1.0′ encoding=’UTF-8′?> <!DOCTYPE email SYSTEM “test.dtd”> <email> <von>[email protected]</von> <zu>[email protected]</zu> <titel>Hello</titel> <text>Dear John….;-).</text> <prior type=”schnell”/> </email> test.dtd <!ELEMENT email (von,zu,titel,text,prior)> <!ELEMENT von (#PCDATA)> <!ELEMENT zu (#PCDATA)> <!ELEMENT titel (#PCDATA)> <!ELEMENT text (#PCDATA)> <!ELEMENT prior EMPTY> <!ATTLIST prior type CDATA #REQUIRED > … Read more

Make DocumentBuilder.parse ignore DTD references

Try setting features on the DocumentBuilderFactory: DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setValidating(false); dbf.setNamespaceAware(true); dbf.setFeature(“http://xml.org/sax/features/namespaces”, false); dbf.setFeature(“http://xml.org/sax/features/validation”, false); dbf.setFeature(“http://apache.org/xml/features/nonvalidating/load-dtd-grammar”, false); dbf.setFeature(“http://apache.org/xml/features/nonvalidating/load-external-dtd”, false); DocumentBuilder db = dbf.newDocumentBuilder(); … Ultimately, I think the options are specific to the parser implementation. Here is some documentation for Xerces2 if that helps.

Why are nested anchor tags illegal?

Keep in mind that an anchor isn’t just a link, it’s also something to which one can link. (Though the former use is far more common than the latter.) Quoting W3C (old, but relevant): An anchor is a piece of text which marks the beginning and/or the end of a hypertext link. To that end, … Read more

What is DOCTYPE?

Basically, the DOCTYPE describes the HTML that will be used in your page. Browsers also use the DOCTYPE to determine how to render a page. Not including a DOCTYPE or including an incorrect one can trigger quirks mode. The kicker here is, that quirks mode in Internet Explorer is quite different from quirks mode in … Read more