I'm doing the same thing but with schema (xsd). What you need to look at is the psvi package. Do a search on psvi and you'll find a few references to it. You can parse the DTD without needing an instance document, then you can walk the metadata and start building. DTD will undoubtedly be different than xsd is.
A few warnings... First, the documentation is very sparse. You may need some help from this group to figure your way around. If you search archives for "psvi" you will find some good suggestions. Secondly, you will encounter some problems when you run into a model group with an xsd:choice definition in it. Which choice do you use to build your sample? When you get an enum, which one of the values do you use for your example? If you have an element that can exist 0 to 20 times, how many times do you include it, or do you include it at all? Using an object designed to validate multiple choice will lead to some issues, when you try to use it to create an example. Good luck! Robert Houben mailto:[EMAIL PROTECTED] http://www.RobertHouben.com/ -----Original Message----- From: Anthony Saucet [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 3:24 AM To: [EMAIL PROTECTED] Subject: building DOM tree using DTD I'm student, new in Dom using. I'd like to create an xml file using a DTD, but don't know how to start with dom api. How can parse a dtd, get the info I need (elements, attributes, values (required, default)) ? do I have to build a DOM tree? how to do it? many thx for helping me anthony --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]