2017-04-27 53 views
1

我使用nginx的,我試圖做使用XSLT轉換在一個XSL轉換格式化URI

我從這裏得到了XSLT列出一個目錄https://gist.github.com/wilhelmy/5a59b8eea26974a468c9

這是打印出來就行了文件

但問題是當前()不做任何URI編碼和文件名與%導致問題。

從我有限的知識中,我使用xslt v1,所以我錯過了一些XQuery?函數行編碼uri。

但我發現 http://www.getsymphony.com/download/xslt-utilities/view/55460/

有一個圖書館?模板編碼的URI

,但我不確定如何改變

包括

,如果我嘗試添加上述在href =」我得到的錯誤。

感謝

回答

0

找到我的答案

   <xsl:element name="a"> 
       <xsl:attribute name="href"> 
        <xsl:call-template name="url-encode"> 
        <xsl:with-param name="str" select="current()" /> 
        </xsl:call-template> 
       </xsl:attribute> 
       <xsl:value-of select="." /> 
       </xsl:element>