我的哈希 (#) "%0A%09%09#2" 前面附加了奇怪的字符,我使用的是 Eclipse 和 java 处理器 Xalan 2.7.1
<xsl:for-each select="fps-photo-atlas/portion">
<a>
<xsl:attribute name="href" >
#<xsl:value-of select="normalize-space(food-number)" />
</xsl:attribute>
<xsl:value-of select="food-description" />
</a>
</xsl:for-each>
首选输出是...
<body><a href="#1">Rice </a></body>
实际输出是..
<body><a href="%0A%09%09#1">Rice </a></body>
已修复解决方案(感谢 Ign)
<xsl:attribute name="href" >#<xsl:value-of select="normalize-space(food-number)" /></xsl:attribute>