Michael Davey wrote:
> Hi,
>
> I am having a problem with betwixt and I am not sure whether it is a bug
> or lack of unserstanding.
> The problem is that XMLIntrospector (actually
> ElementDescriptor.hasAttributes()) does not see the 'id' attribute for
> my inner class when looking for the ID/IDREF attribute
> (getIDAttribute()) while preparing to write the class.
After further investigation...
The problem occurs when ElementDescriptor.hasAttributes() is called
before ElementDescriptor.getAttributeDescriptors().
Possible fixes:
Change javadoc for hasAttributes() to state that
"getAttributeDescriptors() MUST be called before hasAttributes()" and
then change XMLIntrospector.findIDAttribute() to comply with the new
contract.
Change hasAttributes() to call getAttributeDescriptors() if
attributes == null. Possible side effects? I'm not familiar with the
code, so I couldn't say.
--
Michael
|