2015-07-03 39 views
1
<?xml version="1.0" encoding="UTF-8"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 
    <xsl:template match="/Root"> 
     <SetShortNames> 
      <xsl:for-each select="/Root/SetShortName"> 
       <SetShortName> 
        **SetShortNameWithNoUnderscoresHere** 
       </SetShortName> 
      </xsl:for-each> 
     </SetShortNames> 
    </xsl:template> 
</xsl:stylesheet> 

最終,我試圖從foreach中匹配的值中刪除所有下劃線。我如何在XSLT中完成這項工作?如何刪除XSLT中的所有下劃線(_)?

回答

3

(假定什麼也沒有更換:)

<xsl:value-of select='translate(., "_", "")' /> 
+1

也做到了,但你的論點是錯誤的順序。應該是

+2

該死的......自從我獲得了我的XSLT之後,已經有一段時間了! – Utkanos

相關問題