当我的XSL样式表遇到此节点:整数值转换为字符重复
<node attribute="3"/>
...它应该将它转换成节点:
<node attribute="***"/>
我的模板中的属性相匹配,并重新创建它,但我不知道如何将值设置为:字符'*'的重复次数与原始属性的值相同。
<xsl:template match="node/@attribute">
<xsl:variable name="repeat" select="."/>
<xsl:attribute name="attribute">
<!-- What goes here? I think I can do something with $repeat... -->
</xsl:attribute>
</xsl:template>
谢谢!
您正在使用哪种XSLT处理器? – AakashM 2010-07-12 12:00:52
假设我们可以做到这一点...为什么?在数据层上工作不太容易? '***'似乎只对表示层有意义。 – polygenelubricants 2010-07-12 12:01:54
好问题(+1)。查看我对XSLT 2.0解决方案的回答。 – 2010-07-12 16:29:14