[jdom-interest] From JSR-102 comments
Jason Hunter
jhunter at collab.net
Tue Jun 12 14:33:41 PDT 2001
> Dear Sir / Madam,
>
> I just started using JDOM beta 6 a couple of weeks ago and have been
> very impressed by it's performance and ease of use. However, I believe
> I may have found a small bug involving attribute default values. If I
> specify an attribute with a default value in the DTD, and use the
> corresponding element in a document but without specifying a value for
> the attribute, then the attribute does not appear in the element's list
> of attributes.
The default attributes are added by the parser, and they will appear if
you build the document using a parser. You probably built the document
using constructors, and in that case you got exactly the
elements/attributes you created. JDOM doesn't look to the DTD; it does
exactly what you dictate. Considering that when elements are created
they exist outside a document, and can later move between documents, it
doesn't make much sense to try to be fancy about default attribs. It's
the same with DOM as I understand it.
-jh-
More information about the jdom-interest
mailing list