[jdom-interest] Doctype entity declaration
jhunter at collab.net
Thu Mar 22 22:53:06 PST 2001
Harry Evans wrote:
> I have been working on support for Internal and External Entity declarations
> within a DocType declaration.
Have you read the commentary I put in TODO recently about this? There's
some questions we need answered.
> While this is mostly done, I am struggling with how to handle the output of
> these declarations with XMLOutputter.
> Should I call DocType.getSerializedForm(), and allow this to write out the
> "children" declarations, or handle this explicitly in XMLOutputter?
> Right now, XMLOutputter.printDocType(...) and DocType.getSerializedForm()
> are basically duplicating the same code. Which is the preferred method of
> outputting a DocType?
The standard at the moment is for the object itself to implement
getSerializedForm() and for XMLOutputter to call that method at the
appropriate time. XMLOutputter handles all whitespace issues. This may
not last, as noted in the TODO. But it's a good standard to follow
right now. There's no reason the XMLOutputter doesn't use
doctype.getSerializedForm(), just an oversight.
More information about the jdom-interest