-
1. xsl:param support
svejk Mar 19, 2011 10:55 AM (in response to edevera)Hi,
I'm interested. I occasionally have the need for xsl:params, so it would be great
to avoid inventing yet another XsltAction the next time.
Btw. perhaps it's an idea to support both static and dynamic parameter passing? That is, parameters can be
fetched from both the JBoss ESB configuration (the ConfigTree) and dynamically from somewhere in the ESB
message.
Regards,
Sven-Jørgen Karlsen
-
2. xsl:param support
tfennelly Mar 21, 2011 6:59 AM (in response to edevera)Hi Eduardo.
These sounds like good enhancements and I think others have asked for them in the past. Does your custom action use/modify XsltAction? Ideally, we'd like to get these enhancements on the XsltAction. If you could supply a patch to XsltAction that adds these, attaching the patch to an enhancement jira, then we can look at adding them to JBoss ESB.
-
3. Re: xsl:param support
edevera Mar 21, 2011 8:55 AM (in response to tfennelly)Hi Tom,
The Jira enhancement issue I have created can be located here:
https://issues.jboss.org/browse/JBESB-3587
I need some time in order to create the patch as the work I have done until now is not very standard in JBoss terms (it depends on a properties file configured in the ConfigTree instead of being fully integrated with the configuration of JBoss ESB). It also relies on the fact that the value to pass the xslt:parameter is a string and that it always is being taken from the ESB message.
I will try to refactor this and create a patch that I will upload to the Jira issue hoping to have some committer pick it up and commit it to the JBoss ESB sources.
-
4. Re: xsl:param support
edevera May 4, 2011 4:28 AM (in response to edevera)I just uploaded a patch with this functionality.
It is important to remark the fact that the value for the xslt parameters must be a string and that it should be placed in the message.
-
5. Re: xsl:param support
minibiti Dec 9, 2011 3:22 AM (in response to edevera)Hi Eduardo,
And thanks for your patch!
I am trying to use it in my project but I am having trouble understanding how to declare things.
Here is what I have in my jboss-esb.xml for the given action:
<action name="action1" class="com.common.XsltActionDynamicParams">
<property name="get-payload-location" value="CanonicalRequest" />
<property name="set-payload-location" value="OutRequest" />
<property name="templateFile" value="/Canonical-to-OutRequest.xsl" />
<property name="resultType" value="STRING" />
<property name="xslt-param">
<property name="name" value="dyn_param"/>
<property name="value" value="my_value"/>
</property>
</action>
And in my Canonical-to-OutRequest.xsl I have:
....
<xsl:template match="/">
<myelement>${dyn_param}</myelement>
</xsl:template>
....
Can you confirm that I use/declare things correctly?
Thanks!
-
6. Re: xsl:param support
minibiti Dec 9, 2011 8:10 AM (in response to minibiti)To answer the second part of my question, Canonical-to-OutRequest.xsl has to look like this:
<xsl:param name="dyn_param" select="'1234'"/>
<xsl:template match="/">
<myelement><xsl:value-of select="$dyn_param"/></myelement>
</xsl:template>
-
7. Re: xsl:param support
minibiti Dec 11, 2011 2:22 AM (in response to minibiti)And to answer the first part of my question, the given action in jboss-esb.xml should look like this:
<action name="action1" class="com.common.XsltActionDynamicParams">
<property name="get-payload-location" value="CanonicalRequest" />
<property name="set-payload-location" value="OutRequest" />
<property name="templateFile" value="/Canonical-to-OutRequest.xsl" />
<property name="resultType" value="STRING" />
<property name="xslt-params">
<xslt-param name="dyn_param" value="my_value_holder"/>
<xslt-param name="dyn_param2" value="my_value_holder2"/>
</property>
</action>
dyn_param is the name of the parameter you will use in your XSL file.
my_value_holder is the name of the variable in your message holding your dynamic value.
-
8. Re: xsl:param support
edevera Feb 7, 2012 3:40 AM (in response to minibiti)Hi Jean-Marc,
I have just realized your comments here. I see that you have solved your problems by yourself and I hope that sooner rather than later the patch is applied to the JBoss ESB product.
Best regards,
Eduardo de Vera