當我的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