XSL 显示某个字符后的属性 [英] XSL Display attribute after a certain character
问题描述
我有一个要显示的属性,但我只想显示它的最后一部分,用-"表示.我正在使用 substring-after 来执行此操作,但这仅在有一个字符时才有效.有时可能有一个,有时可能有两个.我已经看到了一些递归模板,但我没有在 For-each 循环中看到它们,就像我在这里看到的那样,我不确定我会把所有东西放在我的 XSL 文档中的什么位置.
这是我的 XML 文档:
这是我的 XSL 文档.我正在使用 XSL 1.0.我正在寻找的结果是我希望将其显示为10mm Drill - Grind me back"而不是10mm Drill-Contour Milling - Grind me back",这是我现在使用 substring-after 函数或其他同样的结果.
<xsl:param name="REPORT">joblist</xsl:param><xsl:param name="LOCALE">en-GB</xsl:param><xsl:param name="FORMAT">html</xsl:param><xsl:template match="/"><html xmlns="http://www.w3.org/1999/xhtml"><头><meta http-equiv="content-type" content="text/html; charset=UTF-8"/><title>工具报告</title>头部><身体><xsl:apply-templates/>