Hello
I'am doing a transformation on struts-config.xml with Modisco generic XML Model.
suppose having following simple struts config:
<struts-config>
<formBeans>
<formBean name="myBean" type="my.beans.MyBeanClass" />
<formBean name="anotherBean" type="my.beans.AnotherBeanClass" />
</formBeans>
<action-mappings>
<action path="/myPath" name="myBean" scope="session" />
<action path="/anotherPath" name="anotherBean" scope="request" />
</action-mapping>
</struts-config>
As you can see, the formBean name is referenced in the action-mappings with the name attribute again.
Suppose I would like to create an information model putting together some of the information from the struts config in a target model like
<info name="myPath" scope="session" type="my.Beans.MyBeanClass" />
lazy rule CreateTypeAttribute {
from
src : Xml!Attribute
to
target : Xml!Attribute (
name <- 'type'
value <- ?????
)
At the point of the ????? I could easily get the name "myBean" from the action element, but what I would like to do at this place is, do a lookup in the formBeans section for the formBean by the referencedName "myBean" and retrieve the type information from it to put it in the target model.
Is there a best practice how to solve this?
I am not quite sure how to access other parts of the model because from my understanding the model parser is within the action section of the source model now. So how can I access the corresponding type information in the formBean section from this position?
Many thx in advance
Rob
[Updated on: Sun, 01 May 2011 14:50]
Report message to a moderator