You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2013/01/12 13:32:12 UTC

[jira] [Commented] (CAMEL-5942) Custom URIResolve not used to load XSTL script

    [ https://issues.apache.org/jira/browse/CAMEL-5942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13551901#comment-13551901 ] 

Claus Ibsen commented on CAMEL-5942:
------------------------------------

This is already possible. You can configure a custom uri resolver on the component / endpoint.
http://camel.apache.org/xslt


See this unit test in the source code: XsltCustomizeURIResolverTest



                
> Custom URIResolve not used to load XSTL script
> ----------------------------------------------
>
>                 Key: CAMEL-5942
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5942
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-xslt
>    Affects Versions: 2.10.3
>         Environment: Windows, Java 1.6
>            Reporter: Thomas 
>
> My problem is to load a XSLT script from database or provided as byte array but not as file in classpath or http.
> A custom uri resolver would do the job. XsltEndpoint uses a ResourceHelper to load the XSTL resource instead of a given custom uri resolver.
> {code}
>     private synchronized void loadResource(XsltBuilder xslt, String resourceUri) throws TransformerConfigurationException, IOException {
>         LOG.trace("{} loading schema resource: {}", this, resourceUri);
>         // prefer to use URL over InputStream as it loads better with http
>         URL url = ResourceHelper.resolveMandatoryResourceAsUrl(getCamelContext().getClassResolver(), resourceUri);
>         xslt.setTransformerURL(url);
>         // now loaded so clear flag
>         cacheCleared = false;
>     }
> {code}
> The ResourceHelper or this method should use the same URIResolver as XsltBuilder.
> Another way would be to make the method above protected to be able to overwrite the behaviour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira