<?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中实现这一目标?
答案 0 :(得分:3)
(假设没有替换:)
<xsl:value-of select='translate(., "_", "")' />