getting the entire DTD in the output file
Hi All,
I have a program that takes an XML file(has DTD and XML in the same file) as input. After parsing it, the output is written into a specified file. The output has first few lines of the DTD and the entire XML part, but is not having the ELEMENT and ATTLIST lines of the DTD.
My code runs like this:
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setValidating(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.newDocument();
db.setErrorHandler(new CustomErrorHandler());
doc = db.parse(inFile);
XmlDocumentxDoc = (XmlDocument) doc;
xDoc.write(new PrintWriter(fos));
TIA,
sri

