Better late than never ... Quoting Barnabas Davoti <[EMAIL PROTECTED]>:
> Hi, > > I'd like to process a configuration file with Digester. The element structure > is > given (predefined), but the attributes are not. It means the user can > introduce > new attribute names. > I was not able to implement this feature with Digester. Since it stores the > attribute values as bean propery values, I should know all the attribute > names > in advance to configure the bean (I use DynaBeans). It's not quite possible > since these custom attribute names will be discovered only during the parsing > > time. The XML instance is well-formed, but obviously not validated. > > Is this a limitation of Digester? Any possible workaround? > > Thanks for your help! > > Barna > In addition to the FactoryCreateRule suggestion (which is a good one), you should also note that the standard SetPropertiesRule will match up attributes to properties without knowing any of that ahead of time ... the only constraint is that the name of the attribute has to correspond to the name of the property. The ways that Struts and Tomcat use [digester] to parse configuration files, for example, benefits tremendously from this feature, because you don't have to add any new digester rules for custom subclasses that have additional properties. Craig McClanahan > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
