The javadoc on SetPropertiesRule:
>>isIgnoreMissingProperty()>>            Are attributes found in the xml 
>>without matching properties to be ignored?


 implies that one should be able to write a rule such as

***<set-properties-rule ignoreMissingProperty="true"/>***

or
***<set-properties-rule ignoreMissingProperties="true"/>***


but obviously these don't work.

Surely it's a common use-case to want to digest arbitrarily complex XML without 
needing to specify one by one every attribute you don't care about? 

Requiring a user to catalog an exhaustive set of attributes all over their 
digester rules creates an extraordinary burden and would also clutter the rules 
as to make them near unreadable.

Unless memory fails me, Digester used to silently ignore missing properties, so 
it seems we've lost something since then. Seems that either of the options 
marked *** would be a better solution than having scores of ignore-elements all 
over the place:

    <set-properties-rule>
      <ignore attr-name="Id"/>
      <ignore attr-name="Address"/>
      <ignore attr-name="email"/>
      <ignore attr-name="favoriteBreakfast"/>
      <ignore attr-name="likesApples"/>
      <ignore attr-name="likesPeaches"/>
    </set-properties-rule>


What is more, when the XML schema is extended to add attributes (common 
occurrence) this pattern of "fail unless explicitly ignored" causes a 
maintenance nightmare.

Reply via email to