L.S.,

The easiest way to add properties to a message is by adding a servicemix-bean (or servicemix-lwcontainer) MessageExchangeListener POJO to receive a message, add the necessary properties and forward to the next hop, in this case your XSL-T transformer.

However... Remember that you can use other types of expressions as well to choose your stylesheet, e.g. XPath expressions. This way, you could choose an XSL-T sheet based on the contents of the XML message to be transformed. And you can always build your own expression implementation.


Regards,

Ger

uniker80 wrote:
thanks :-)
Regards,
Piotr

but i have one more question .. how could i pass the value of properties..?

i know it is possible to pass values, on exchange or message..
but i cannot find how to do it.

help me please
dear Regards, Piotr




Piotr Bzdyl wrote:
Hi,

Use <saxon:xslt expression="..."> attribute to specify reference to the
actual expression instead of using <saxon:expression> element.

There is several types of expressions (and you can create your own types).
Let's take following example:
<saxon:xslt service="setest:saxon-xslt-dynamic"
endpoint="saxon-xslt-dynamic-endpoint" expression="#myExpression">

You can define for example:

<bean id="myExpression"
class="org.apache.servicemix.expression.PropertyExpression">
    <property name="property" value="my.custom.propertyName" />
</bean>

This will try to find property named "my.custom.propertyName" in your
NormalizedMessage. If it can't find such a property, then
PropertyExpression will try to do the same with your MessageExchange. The
value of the property will be used as a name for you xslt filename.

Other expression implementations you might be interested in are:
FileExtensionPropertyExpression, JAXPXPathExpression,
JaxenXPathExpression, or just write your own by implementing
org.apache.servicemix.expression.Expression.

Regards,
Piotr




Reply via email to