we are trying to use xsl for converting xml to our custom xml format using camel and its out of the box xslt support here is a sample route
<from uri="file://target/inventory/updates?noop=true"/>
<unmarshal>
<csv />
</unmarshal>
<to uri="bean:XMLConverter?method=processCSVInvoice" />
<to uri="xslt:file//target/inventory/updates/xlsconvertor/XMLConverter.xsl"/>
<to uri="file://target/inventory/updates/test?fileName=test11.xml"/>
</route>
my problem is when i am putting this xls file in the class path camel is happily picking the xls and doing the work as per the route but moment we are placing the xls file out开发者_如何学运维 of class path like in a file system camel is unable to resolve this and we are struck as the whole purpose to use xls is to take custom xml formatting out of the jar
as a workaround i tried to create a customURLResolver and than tried to use it as
<from uri="file://target/inventory/updates?noop=true"/>
<unmarshal>
<csv />
</unmarshal>
<to uri="bean:XMLConverter?method=processCSVInvoice" />
<to uri="xslt:file//target/inventory/updates/xlsconvertor/XMLConverter.xsl?uriResolver=customURIResolver"/>
<to uri="file://target/inventory/updates/test?fileName=test11.xml"/>
</route>
but in this case camel is not calling my customURIResolver any idea how i can make camel to use my custom URIResolver in place of its default resolver
You should most likely use # to indicate its a reference to a bean in the registry.
Try configuring the uri as follows: uriResolver=#customURIResolver
精彩评论