You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by uniker80 <un...@gmail.com> on 2007/06/26 11:59:49 UTC

how can i select XSLT stylesheet dynamically?

i deployed XSLT SU, with xbean.xml, for dynamic stylesheet selection..

  <saxon:xslt service="setest:saxon-xslt-dynamic"
endpoint="saxon-xslt-dynamic-endpoint">
    <saxon:expression>
      <bean class="org.apache.servicemix.expression.PropertyExpression">
        <property name="property" value="xslt.source" />
      </bean>
    </saxon:expression>
  </saxon:xslt>

but i don't know, how can i select the stylesheet.. 
and what does "xslt.source" mean?

anyone please help me.
im a novice for servicemix .....



-- 
View this message in context: http://www.nabble.com/how-can-i-select-XSLT-stylesheet-dynamically--tf3981472s12049.html#a11302852
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: how can i select XSLT stylesheet dynamically?

Posted by uniker80 <un...@gmail.com>.
Thanks very much :-)
Regards, Ger



Gert Vanthienen wrote:
> 
> 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
>>>
>>>
>>>     
>>
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/how-can-i-select-XSLT-stylesheet-dynamically--tf3981472s12049.html#a11335399
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: how can i select XSLT stylesheet dynamically?

Posted by Gert Vanthienen <ge...@skynet.be>.
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
>>
>>
>>     
>
>   


Re: how can i select XSLT stylesheet dynamically?

Posted by uniker80 <un...@gmail.com>.
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
> 
> 

-- 
View this message in context: http://www.nabble.com/how-can-i-select-XSLT-stylesheet-dynamically--tf3981472s12049.html#a11317359
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: how can i select XSLT stylesheet dynamically?

Posted by Piotr Bzdyl <pi...@bzdyl.net>.
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

-- 
View this message in context: http://www.nabble.com/how-can-i-select-XSLT-stylesheet-dynamically--tf3981472s12049.html#a11304862
Sent from the ServiceMix - User mailing list archive at Nabble.com.