DTD parsing

hi guys,

is it possible to get generate a DOM-like tree structure from a dtd parser.

actually i intend to use a DTD parser to parse a given a DTD file and generate the structure in a JTree format. i thought using DOM wud be good idea.

i am using a parser from www.wutka.com

the following code gets me only the elements, without specifying who is the child of whom. as i said above ,can i modify this to get the elements in a hierarchical form.

FileReader DTDRead =new FileReader("D:\\Documents\\Vineet's Documents\\MYPROG\\GenerateForm.dtd");

DTDParser dtdParser =new DTDParser(DTDRead);

DTD dtd=dtdParser.parse();

java.util.Hashtable dtdElements = dtd.elements;

java.util.Enumeration iter = dtdElements.elements();

String a;int i=0;

while (iter.hasMoreElements()){

DTDElement dtdElement = (DTDElement)(iter.nextElement());

a=dtdElement.getName();

arr[i]=a;

i++;

System.out.println(dtdElement.getName());

[1195 byte] By [takeawaymypaina] at [2007-11-26 15:44:09]
# 1
I know nothing about your www.wutka.com parser.If it's me, I'd write a custom parser becuase the structure of DTD is simple.
hiwaa at 2007-7-8 22:03:11 > top of Java-index,Java Essentials,Java Programming...
# 2
if u know anywhere i can get a DTD DOM parser....please tell me....i'll be very gratefullthanks
takeawaymypaina at 2007-7-8 22:03:11 > top of Java-index,Java Essentials,Java Programming...