[jdom-interest] Default document constructor
jhunter at acm.org
Tue Jan 8 09:45:45 PST 2002
You explained the issue quite nicely. It's a nice-to-have feature but
on the other hand you're creating a non-well-formed document. Right now
we're in a compromise state with passing null as a power-user feature.
Any push to the other direction hits resistance.
Kevin Jones wrote:
> Why is the default Document constructor protected?
> I can understand logically that a Document should contain some content
> (and according to the XML specs must contain a root element) but it
> would often make my programming logic more logical if I could create an
> empty document and then add content to it, rather than creating content
> first and constructing the document with that content.
> I can create an empty document (in at least two ways I think)
> new Document((org.jdom.Element)null);
> where the cast could also be to java.util.List.
> elem = new Element("foo");
> doc = new Dcoument(elem);
> And this is sometimes necessary (especially the second case), so 'naked'
> Documents are possible. This would seem a nice-to-have feature,
> Kevin Jones
> To control your jdom-interest membership:
More information about the jdom-interest