
July 5th, 2003, 10:11 PM
|
|
Junior Member
|
|
Join Date: Jul 2003
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Urgent help needed, ignoring DTD comments and default attributes (JAXP)
I have an XML file from which I build a DOM using a validating parser. I then set some values for some tags, and transform the DOM into a string, which then goes out on the wire. However, the resulting string contains ALL the comments that are inside the DTD (setIgnoringComments(true) in DocumentBuilderFactory only seems to take care of the comments in the XML file itself, not the DTD against which it is validated when the DOM is built).
This, however, is not that big of a deal. It does make for a larger-than-needed message, but I can live with that. The bigger problem is that the resulting string also contains all the default attributes specified in the DTD for all the tags. This is breaking the application receiving the message on the other end. None of these attributes are mandatory, so I would like to just have the tags w/out them.
I cannot find any transform or DocumentBuilder APIs to ignore DTD comments and default attributes. If anyone has any ideas, please help, this is quite urgent.
Thanks!
|