You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/08/07 09:06:00 UTC

[jira] [Commented] (CAMEL-12713) relative paths can remove scheme from xslt URI

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

ASF GitHub Bot commented on CAMEL-12713:
----------------------------------------

GitHub user pvdbosch opened a pull request:

    https://github.com/apache/camel/pull/2456

    CAMEL-12713 - XsltUriResolver fix: relative imports can ignore URI scheme 

    fix for CAMEL-12713
    
    FileUtil.compactPath() is used to calculate the relative URI, but this call ignores the colon separator and considers "classpath:directory" as a single path part. 
    
    This patch passes the URI without its scheme to FileUtil.compactPath() and attaches it again to the result. 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kszbcss/camel xslt-resolver-fix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/2456.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2456
    
----
commit 4b957bd345a38a4cadd9e492b0ea7a9325c2a551
Author: pvdbosch <pe...@...>
Date:   2018-08-06T15:58:56Z

    CAMEL-12713 - XsltUriResolver fix: relative paths can remove scheme from XSLT URI

----


> relative paths can remove scheme from xslt URI
> ----------------------------------------------
>
>                 Key: CAMEL-12713
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12713
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.22.0
>            Reporter: Peter Van den Bosch
>            Priority: Major
>              Labels: xslt
>
> When using relative paths in an XSLT referenced from another one, the used URI scheme may be ignored.
> e.g. in case of an XSLT specified by URI "classpath:location/master.xsl",  that includes another one:  <xsl:include href="../child.xsl"/>
> In this case, the URI of child.xsl is resolved as just "child.xsl" instead of "classpath:child.xsl", omitting the URI scheme.
> The cause is XsltUriResolver, in which FileUtil.compactPath() is used to calculate the relative URI, but this call ignores the colon separator and considers "classpath:location" as a single path part.
> I'm creating a pull request which passes the URI without scheme to FileUtil.compactPath().



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)