[jdom-interest] Default document constructor
Bradley S. Huffman
hip at a.cs.okstate.edu
Tue Jan 8 11:17:05 PST 2002
What's wrong with the idea in the TODO list, "allowing a Doc to have its
root removed with an ISE upon later access".
You get the convenience of a 'naked' Document, but are still protected
Jason Hunter writes:
> 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)
> > e.g.
> > new Document((org.jdom.Element)null);
> > where the cast could also be to java.util.List.
> > or
> > elem = new Element("foo");
> > doc = new Dcoument(elem);
> > elem.detach();
> > And this is sometimes necessary (especially the second case), so 'naked'
> > Documents are possible. This would seem a nice-to-have feature,
> > Kevin Jones
> > Developmentor
> > www.develop.com
> > _______________________________________________
> > To control your jdom-interest membership:
> > http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourho
> To control your jdom-interest membership:
More information about the jdom-interest