commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paul anderson <>
Subject [digester] XML rules, set-properties-rule, and ignoring missing properties
Date Fri, 28 Feb 2014 16:57:58 GMT
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"/>***

***<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:

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

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.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message