I use JAXP and dom with my xml file to read data, change it and then write the data back to xml file. Problem is that in my new xml file DTD specification is gone. Shortly, from the second line in my xml file that row is missing: <!DOCTYPE scores SYSTEM "scores.dtd">
this is how i write data(Document document) to my xml file:
I don't know what should i do.
[ August 19, 2004: Message edited by: Juhan Voolaid ] [ August 21, 2004: Message edited by: Juhan Voolaid ]
Joined: Nov 18, 2003
OK, found it. If anyone is interested then this should be added to transformer: transformer.setOutputProperty(javax.xml.transform.OutputKeys.DOCTYPE_SYSTEM, dtd); where dtd is string "dtdFile.dtd"