commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From José Antonio Pérez Testa <japte...@indra.es>
Subject Re: [Digester] How to apply rules on XML tags (SAX events) based on previously encountered tags?
Date Wed, 13 Apr 2005 14:46:35 GMT
IMO you must code this logic in the Objects instantiated by Digester.
You can not take actions based on element's attributes ("MEGA", 
"Preview"), but you can set properties
of objects in order to make appropiate decisions when they are called 
from Digester parsing.


Soaring Eagle wrote:

>Hello,
>
>I am using Digester to create a rules engine for an application. This
>rules engine should be capable of determining what should be done for
>certain type of financial securities based on their type and the
>business event that has occured. Such rules are maintained in XML. How
>do I apply digester rules based on nested criteria in this case?
>
>For example, in the XML below, I would like to instantiate the class
>com.services.EmailAction only if the type of security is "MEGA" and
>the action is "Publish". How do i do that?
>
>--
>Thanks in advance!
>Eagle
>
><Services>
>	<Security type="DUSARM">
>		<Event type="Preview">
>			<Action>
>				<ClassName>
>					com.services.EmailAction
>				</ClassName>
>				<ClassName>
>					com.services.EmailAction
>				</ClassName>
>			</Action>
>		</Event>
>	</Security>
>	<Security type="MEGA">
>		<Event type="Preview">
>			<Action>
>				<ClassName>
>					com.services.EmailAction
>				</ClassName>
>				<ClassName>
>					com.services.EmailAction
>				</ClassName>
>			</Action>
>		</Event>
>	</Security>
></Services>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>  
>


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