FAQ
Hi,

this is actually my first day working with camel and I have to admit I
allready love it. Currently I am stuck with one last thing to have my first
camel project up and running.

I have one route that starts by loading xml files from the filesystem. A
processor then adds a client-id to the requests header based on the content
of the xml.

My customers requirement is that there are some clients that need special
processing. For these customers there should be an xsl transformation with
an uri like this:
"xslt://file:custom-transformations/${headers.gst}/convert.xslt". I have
managed to check if the file exists and to use a different path in that
case. The problem is, that Camel doesn't seem to like dynamic uris ... how
could I manage to achieve this?

Here a shortend version of my route ...
<camel:route>
<camel:from
uri="file:input?move=imported&amp;moveFailed=failed&amp;filter=#xmlInputFilter"/>
<camel:convertBodyTo type="org.w3c.dom.Document"/>

<camel:process ref="gstDataCsvProcessor"/>
<camel:choice>
<camel:when>

<method ref="applyCustomTransformationPredicate"/>

<camel:to
uri="xslt://file:custom-transformations/${headers.gst}/convert.xslt"/>
<camel:to
uri="xslt://file:xslt/ToEasySPED.xslt?contentCache=false"/>
<camel:to uri="file:output"/>
</camel:when>
<camel:otherwise>
<camel:to
uri="xslt://file:xslt/ToEasySPED.xslt?contentCache=false"/>
<camel:to uri="file:output"/>
</camel:otherwise>
</camel:choice>
</camel:route>

I would really appreciate some help with this last step.

Chris

--
View this message in context: http://camel.465427.n5.nabble.com/dynamic-uri-of-xsl-transformation-tp5508662p5508662.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Search Discussions

  • Claus Ibsen at Feb 23, 2012 at 5:32 pm
    Hi

    Welcome on the Camel ride.

    Seems you got pretty far on your first day.

    About the dynamic to, then there is a EIP pattern for that. We have
    added a FAQ about this at
    http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html

    On Thu, Feb 23, 2012 at 6:06 PM, chrisdutz wrote:
    Hi,

    this is actually my first day working with camel and I have to admit I
    allready love it. Currently I am stuck with one last thing to have my first
    camel project up and running.

    I have one route that starts by loading xml files from the filesystem. A
    processor then adds a client-id to the requests header based on the content
    of the xml.

    My customers requirement is that there are some clients that need special
    processing. For these customers there should be an xsl transformation with
    an uri like this:
    "xslt://file:custom-transformations/${headers.gst}/convert.xslt". I have
    managed to check if the file exists and to use a different path in that
    case. The problem is, that Camel doesn't seem to like dynamic uris ... how
    could I manage to achieve this?

    Here a shortend version of my route ...
    <camel:route>
    <camel:from
    uri="file:input?move=imported&amp;moveFailed=failed&amp;filter=#xmlInputFilter"/>
    <camel:convertBodyTo type="org.w3c.dom.Document"/>

    <camel:process ref="gstDataCsvProcessor"/>
    <camel:choice>
    <camel:when>

    <method ref="applyCustomTransformationPredicate"/>

    <camel:to
    uri="xslt://file:custom-transformations/${headers.gst}/convert.xslt"/>
    <camel:to
    uri="xslt://file:xslt/ToEasySPED.xslt?contentCache=false"/>
    <camel:to uri="file:output"/>
    </camel:when>
    <camel:otherwise>
    <camel:to
    uri="xslt://file:xslt/ToEasySPED.xslt?contentCache=false"/>
    <camel:to uri="file:output"/>
    </camel:otherwise>
    </camel:choice>
    </camel:route>

    I would really appreciate some help with this last step.

    Chris

    --
    View this message in context: http://camel.465427.n5.nabble.com/dynamic-uri-of-xsl-transformation-tp5508662p5508662.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: [email protected]
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/
  • Chrisdutz at Feb 27, 2012 at 6:49 am
    Hi Claus,

    thanks for that hint. I have to admit that I allready saw hints on this
    while googling around, but I thougt it didn't fit my usecase. Now I tried it
    and it works :-)

    Thanks,
    Chris

    --
    View this message in context: http://camel.465427.n5.nabble.com/dynamic-uri-of-xsl-transformation-tp5508662p5518080.html
    Sent from the Camel - Users mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedFeb 23, '12 at 5:26p
activeFeb 27, '12 at 6:49a
posts3
users2
websitecamel.apache.org

2 users in discussion

Chrisdutz: 2 posts Claus Ibsen: 1 post

People

Translate

site design / logo © 2023 Grokbase