The XML Validation subject area is quite complex. The reason for this is that when there is intelligence in your data, as XML often has, it can be organized in a variety of ways. One approach with XML data is to oversee its integrity with the use of DTD schemas, which is like a blueprint for your XML data, outlining how it should be structured to pass validation checks. If you know your XML data passes the validation tests implied by the DTD then you are likely to have a very successful project, if the DTD has been structured methodically and has enough flexibility to express all the complication needed to satisfy business logic requirements.
Java has functionality to help with validating XML in a variety of different scenarios, as do other languages such as Python, for example. Here, as with Python, we are using a SAX approach, and for this tutorial there were two huge contributions from:
- the Eclipse IDE XML examples provided
- a very good tutorial here about validating XML against a real existing DTD
In this primer tutorial you can see some Java XML and DTD validation program in action on a Mac laptop.
Link to downloadable Java (via Eclipse) programming source code for XML and DTD validation XMLPlusDTDValidate.java
Link to sample Eclipse DTD data Invoice.dtd
Link to sample Eclipse XML data Invoice.xml
If this was interesting you may be interested in this too.



The distinction between course-driven and immersion-driven learning is useful. A small extension to the australia.htm exercise would be a set of named map markers and a text filter: first update the visible markers on an input event, then add a collected/uncollected toggle, and finally persist only that toggle state in localStorage. That gives beginners a concrete reason to learn arrays, DOM updates and browser storage without needing PHP or MySQL first. It is also worth testing empty searches, a page reload and disabled storage separately; those are different failure cases. Disclosure: we maintain the GTA 6 interactive map. I am suggesting it as an example of a map-and-progress interface, not claiming that we used the tutorial code. Would you introduce persistence after the first working interaction, or keep the initial exercise entirely stateless?