commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <skitch...@apache.org>
Subject Re: Digester wildcard question
Date Thu, 23 Jun 2005 10:16:00 GMT
On Tue, 2005-06-21 at 10:18 -0500, Mykel Alvis wrote:
> I have a slightly different need than Frank, but I'm posting with the
> same subject line. :)
> 
> I'm using XML digester rules to parse configurations.  I have a series
> of tags that I think should be matched as wildcards but don't seem to
> be.

>     <pattern value="javerules/rulesets/ruleset">
...
>         <pattern value="rule">
...
>             <pattern value="*/message">
>                 <object-create-rule classname="Message" />
>                 <set-next-rule methodname="add" paramtype="Consequence" />
>                 <set-properties-rule/>
>             </pattern>

I don't use xmlrules much, but would bet money that this generates a
pattern of "javerules/rulesets/ruleset/rule/*/message". And that sort of
pattern isn't supported by any of the existing rule managers.

The standard RulesBase will support "*/message". The ExtendedBaseRules
will support "message/*". But neither will support a wildcard in the
middle. Well, maybe the RegExRules will, but you don't want to go there
I think.

If you really do want to match "message" elements anywhere in the
document then I suggest moving that <pattern value="*/message"> out to
the top level instead of nesting it within other pattern tags.

>>From a brief glance at your rules and examples, though, you might be
better off just duplicating the message stuff under both the true and
false elements.

It looks like an interesting layer you're building on top of digester.
Are you at liberty to discuss what you're trying to achieve?


Regards,

Simon



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message