[jdom-interest] From JSR-102 comments

philip.nelson at omniresources.com philip.nelson at omniresources.com
Tue Jun 12 14:41:08 PDT 2001


> > 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.

I am not sure what parser this person used or what the dtd actually looked
like, but this was exactly the problem some of the xerces parsers seemed to
have with the svg dtd which included default values in parameter entities.



More information about the jdom-interest mailing list