Add tags

Add tags to the following comment
こーゆーのが、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>円(税込み)です。&#xA;</xsl:text>
  </xsl:template>

</xsl:stylesheet>

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...