[jdom-interest] BUG: No attributes in new Elements

Peter Franken Peter.Franken at pfr.de
Wed Feb 7 13:13:19 PST 2001


At 12:17 07.02.2001 -0800, Jason Hunter wrote:
>Peter Franken wrote:
> > If I create a new Element, the attributes from the DTD
> > aren't added. (I cannot find any of the attributes defined in the DTD-file)
>
>Default attributes from a DTD aren't added when you construct an
>Element, nor is that a feasible feature to implement in my opinion.
>Elements may exist separate from a document and be moved within a
>document, which means your proposal would have attributes automatically
>added or removed depending on element position.
>
>The model is that JDOM ensures documents are well-formed at runtime, and
>will (sometime in the future) allow validity to be checked on request.

This means, even if I have no attributes for an element during creation, I 
will find them with the same element as soon as I write and re-read the 
XML. This makes the information inconsistent.
There should be at least an option to reattach the attributes to the 
element the same way as if the element was created during buildTree().

But maybe I'm wrong and I should check the DTD parser to find another 
chance to attach the attributes to a self-created element. :-)
Nevertheless, any help is appreciated!


cu
Peter




More information about the jdom-interest mailing list