Thanks Ulf....however.
Not an encouraging point from the following article (
http://www.onjava.com/pub/a/onjava/excerpt/learnjava_23/index4.html#49809): To use our DTD, we must associate it with the XML document. We do this by placing a DOCTYPE declaration in the XML itself. When a validating parser encounters the DOCTYPE, it attempts to load the DTD and validate the document. There are several forms the DOCTYPE can have, but the one we'll use is:
<!DOCTYPE Inventory SYSTEM "zooinventory.dtd">
Both SAX and DOM parsers can automatically validate documents that contain a DOCTYPE declaration. However, you have to explicitly ask the parser factory to provide a parser that is capable of validation. To do this, set the validating property of the parser factory to true before you ask it for an instance of the parser. For example:
SAXParserFactory factory = SAXParserFactory.newInstance( );
factory.setValidating( true );
----------------
Which further states "Although DTDs can define the basic structure of an XML document, they can't adequately describe data and validate it programmatically."
Unless I am missing a trick of course.
Stuart