XMLチュートリアル

XMLホーム XMLの紹介 XML使用方法 XMLツリー XML構文 XML要素 XML属性 XML名前空間 XML表示 XML HttpRequest XMLパーサー XML DOM XML XPath XML XSLT XML XQuery XML XLink XMLバリデーター XML DTD XMLスキーマ XMLサーバー XMLの例 XMLクイズ XML証明書

XML AJAX

AJAXの紹介 AJAX XMLHttp AJAXリクエスト AJAX応答 AJAXXMLファイル AJAX PHP AJAX ASP AJAXデータベース AJAXアプリケーション AJAXの例

XML DOM

DOMの紹介 DOMノード DOMアクセス DOMノード情報 DOMノードリスト DOMトラバース DOMナビゲーション DOMは値を取得します DOM変更ノード DOM削除ノード DOM置換ノード DOM作成ノード DOM追加ノード DOMクローンノード DOMの例

XPathチュートリアル

XPathの概要 XPathノード XPath構文 XPath軸 XPath演算子 XPathの例

XSLTチュートリアル

XSLTの紹介 XSL言語 XSLT変換 XSLT <テンプレート> XSLT <値> XSLT <for-each> XSLT <ソート> XSLT <if> XSLT <選択> XSLT適用 クライアント上のXSLT サーバー上のXSLT XSLT Edit XML XSLTの例

XQueryチュートリアル

XQueryの紹介 XQueryの例 XQuery FLWOR XQuery HTML XQueryの用語 XQuery構文 XQuery追加 XQuery Select XQuery関数

XML DTD

DTDの紹介 DTDビルディングブロック DTD要素 DTD属性 DTD要素と属性 DTDエンティティ DTDの例

XSDスキーマ

XSDの概要 XSDハウツー XSD <スキーマ> XSD要素 XSD属性 XSDの制限

XSDコンプレックス

XSD要素 XSDが空です XSD要素のみ XSDテキストのみ XSD混合 XSDインジケーター XSD <任意> XSD <anyAttribute> XSD置換 XSDの例

XSDデータ

XSD文字列 XSD日付 XSD数値 XSDその他 XSDリファレンス

Webサービス

XMLサービス XML WSDL XML SOAP XML RDF XML RSS

参考文献

DOMノードタイプ DOMノード DOM NodeList DOM NamedNodeMap DOMドキュメント DOM要素 DOM属性 DOMテキスト DOM CDATA DOMコメント DOM XMLHttpRequest DOMパーサー XSLT要素 XSLT / XPath関数

XSLT <xsl:number>


❮完全なXSLT要素リファレンス

定義と使用法

<xsl:number>要素は、ソース内の現在のノードの整数位置を決定するために使用されます。数値のフォーマットにも使用されます。


構文

<xsl:number
count="expression"
level="single|multiple|any"
from="expression"
value="expression"
format="formatstring"
lang="languagecode"
letter-value="alphabetic|traditional"
grouping-separator="character"
grouping-size="number"/>

属性

Attribute Value Description
count expression Optional. An XPath expression that specifies what nodes are to be counted
level single
multiple
any
Optional. Controls how the sequence number is assigned

Can be one of the following:

  • single (default)
  • multiple
  • any (not supported by Netscape 6)
from expression Optional. An XPath expression that specifies where the counting will start
value expression Optional. Specifies a user-provided number that is used in place of a sequence generated number
format formatstring Optional. Defines the output format for the number. Can be one of the following:
  • format="1" results in 1 2 3 . .
  • format="01" results in 01 02 03 (not supported by Netscape 6)
  • format="a" results in a b c . . (not supported by Netscape 6)
  • format="A" results in A B C. . (not supported by Netscape 6)
  • format="i" results in i ii iii iv . . (not supported by Netscape 6)
  • format="I" results in I II III IV . . (not supported by Netscape 6)
lang languagecode Optional. Specifies the language alphabet to be used for the numbering (Not supported by Netscape 6)
letter-value alphabetic
traditional
Optional. Specifies whether the numbering in the selected language is alphabetic or traditional. The default is alphabetic
grouping-separator character Optional. Specifies what character should be used to separate groups of digits. The default is the comma
grouping-size number Optional. Specifies how many digits are in the groups that are being separated by the character specified in the grouping-separator attribute. The default is 3

例1

<xsl:number value="250000" grouping-separator="."/>

Output:

250.000

例2

<xsl:number value="250000" grouping-size="2"/>

Output:

25,00,00

例3

<xsl:number value="12" grouping-size="1"
grouping-separator="#" format="I"/>

Output:

X#I#I

例4

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
  <html>
  <body>
  <p>
  <xsl:for-each select="catalog/cd">
    <xsl:number value="position()" format="1" />
    <xsl:value-of select="title" /><br />
  </xsl:for-each>
  </p>
  </body>
  </html>
</xsl:template>

</xsl:stylesheet>

❮完全なXSLT要素リファレンス