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());

