[jdom-interest] setExpandEntities and XMLOutputter behaviour
manish.sharan at divlogic.com
Thu May 6 10:56:30 PDT 2004
Ok so this is how I solved it :
This preserves the original xhtml doctype declaration and cleans out the
Even though this is working for me , I can see that the issue remains :
shouldnt document.getDocType().getIternalSubset() return only the
internal DTD ? It seems that when setExpandEntities(false) is set,
somehow the external DTDs also end up in internal subset which means the
when you output using XMLOutputter, all the content from the external DTDs
get included in the output
Is this a bug or a expected behaviour ?
> If I setDocType(null) before xmloutputter is invoked, it does not output
> the doctype at all -- but since this is a xhtml document, I need the
> doctype do be preserved.
> Is there to override the Xmloutputter.output(DocType doctype,
> java.io.OutputStream out) behaviour so that it does not write out the
> external DTDs inside the Doctype declarartion?
> Btw, I am setting saxBuilder.setExpandEntities(false) so that I preserve
> the entities in the xhtml document leaving this task to the
>> Manish Sharan wrote:
>>> When I set saxBuilder.setExpandEntities(false) and output the docment
>>> using XMLOutputter, the XMLOutputter includes all the external DTDs
>>> within the Doctype declaration. This does not happen when
>>> setExpandEntities(true) is used.
>>> I am aware that an XML parser will by default load the external DTD
>>> but Is there a way to ensure that the XMLOutputter does not include
>>> (the external DTDs)in its output.
>> Can't you remove the DocType object from the Document before outputting
>> using Document.setDocType(null) ?
> To control your jdom-interest membership:
More information about the jdom-interest