turugina #6636(2008/07/01 04:49 GMT) [ XSLT ] Rating0/0=0.00
こーゆーのが、XSLTの本来の使い方かと。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <!-- 以下のようなxml文書を渡します <item name="りんご" cost="200" /> --> <xsl:output method="text" encoding="sjis" /> <xsl:template match="/item" > <xsl:call-template name="showPrice" /> </xsl:template> <xsl:template name="showPrice"> <xsl:text>「</xsl:text> <xsl:value-of select="@name" /> <xsl:text>」は</xsl:text> <xsl:value-of select="floor(@cost * 1.05)" /> <xsl:text>円(税込み)です。
</xsl:text> </xsl:template> </xsl:stylesheet>
Rating0/0=0.00-0+
[ reply ]
turugina
#6636()
[
XSLT
]
Rating0/0=0.00
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <!-- 以下のようなxml文書を渡します <item name="りんご" cost="200" /> --> <xsl:output method="text" encoding="sjis" /> <xsl:template match="/item" > <xsl:call-template name="showPrice" /> </xsl:template> <xsl:template name="showPrice"> <xsl:text>「</xsl:text> <xsl:value-of select="@name" /> <xsl:text>」は</xsl:text> <xsl:value-of select="floor(@cost * 1.05)" /> <xsl:text>円(税込み)です。
</xsl:text> </xsl:template> </xsl:stylesheet>Rating0/0=0.00-0+
[ reply ]