aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/xslt/number/index.html
blob: da7238cd4fd2db71b08f73ffb0fc3aa35390b59c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
---
title: number
slug: Web/XSLT/number
tags:
  - Todas_las_Categorías
  - XSLT
translation_of: Web/XSLT/Element/number
---
<p>{{XsltRef}}</p>

<p>El elemento <code>&lt;xsl:number&gt;</code> hace conteos secuenciales. También puede ser usado para darle formato a los números.</p>

<h3 id="Sintaxis" name="Sintaxis">Sintaxis</h3>

<pre>&lt;xsl:number
	count=EXPRESION
	level="single" | "multiple" | "any"
	from=EXPRESION
	value=EXPRESION
	format=FORMAT-STRING
	lang=XML:LANG-CODE
	letter-value="alphabetic" | "traditional"
	grouping-separator=CARACTER
	grouping-size=NUMERO  /&gt;</pre>

<h3 id="Atributos_requeridos" name="Atributos_requeridos">Atributos requeridos</h3>

<p>Ninguno.</p>

<h3 id="Atributos_opcionales" name="Atributos_opcionales">Atributos opcionales</h3>

<dl>
 <dt><code>count</code></dt>
 <dd>Indica que es lo que debe ser numerado de manera secuencial. Usa una expresión XPath.</dd>
</dl>

<dl>
 <dt><code>level</code></dt>
 <dd>Define cuantos niveles del documento deben ser tomados en cuenta para generar la secuencia numérica. Tiene 3 valores permitidos: <code>single</code>, <code>multiple</code>, y <code>any</code>. El valor por preestablecido es <code>single</code>:</dd>
</dl>

<dl>
 <dd>
 <dl>
  <dt><code>single</code></dt>
  <dd>Numera los nodos hermanos de manera secuencia, como en los listados. ... CONTINUAR DESDE AQUÍ...</dd>
  <dd>Numbers sibling nodes sequentially, as in the items in a list. The processor goes to the first node in the <a href="es/Transforming_XML_with_XSLT/Mozilla_XSLT%2f%2fXPath_Reference/Axes/ancestor-or-self"><code>ancestor-or-self</code></a> axis that matches the <code>count</code> attribute and then counts that node plus all its preceding siblings (stopping when it reaches a match to the <code>from</code> attribute, if there is one) that also match the <code>count</code> attribute.If no match is found, the sequence will be an empty list.</dd>
 </dl>
 </dd>
</dl>

<dl>
 <dd>
 <dl>
  <dt><code>multiple</code></dt>
  <dd>Numbers nodes as a composite sequence that reflects the hierarchic position of the node, e.g. 1.2.2.5. (The nested format can be specified with the <code>format</code> attribute, e.g. A.1.1). The processor looks at all <a href="es/Transforming_XML_with_XSLT/Mozilla_XSLT%2f%2fXPath_Reference/Axes/ancestor"><code>ancestors</code></a> of the current node and the current node itself, stopping when it reaches a match for the <code>from</code> attribute, if there is one. For each node in this list that matches the <code>count</code> attribute, the processor counts how many preceding matching siblings it has, and adds one for the node itself. If no match is found, the sequence will be an empty list.</dd>
 </dl>
 </dd>
</dl>

<dl>
 <dd>
 <dl>
  <dt><code>any</code> (Not supported at this time.)</dt>
  <dd>Numbers all matching nodes, regardless of level, sequentially. The <a href="es/Transforming_XML_with_XSLT/Mozilla_XSLT%2f%2fXPath_Reference/Axes/ancestor"><code>ancestor</code></a>, <a href="es/Transforming_XML_with_XSLT/Mozilla_XSLT%2f%2fXPath_Reference/Axes/self"><code>self</code></a>, and <a href="es/Transforming_XML_with_XSLT/Mozilla_XSLT%2f%2fXPath_Reference/Axes/preceding"><code>preceding</code></a> axes are all considered. The processor starts at the current node and proceeds in reverse document order, stopping if it reaches a match to any <code>from</code> attribute. If no match to the <code>count</code> attribute is found, the sequence will be an empty list. This level is not supported at this time.</dd>
 </dl>
 </dd>
</dl>

<dl>
 <dt>from</dt>
 <dd>Specifies where the numbering should start or start over. The sequence begins with the first descendant of the node that matches the <code>from</code> attribute.</dd>
</dl>

<dl>
 <dt>value</dt>
 <dd>Applies a given format to a number. This is a quick way to format a user-supplied number (as opposed to a node sequence number) in any of the standard <code>&lt;xsl:number&gt;</code> formats.</dd>
</dl>

<dl>
 <dt>format</dt>
 <dd>Defines the format of the generated number:</dd>
</dl>

<dl>
 <dd>
 <dl>
  <dt>format="1"</dt>
  <dd>1 2 3 . . . (This is the only format supported at this time)</dd>
 </dl>
 </dd>
</dl>

<dl>
 <dd>
 <dl>
  <dt>format="01"</dt>
  <dd>01 02 03 . . . 09 10 11 . . .</dd>
 </dl>
 </dd>
</dl>

<dl>
 <dd>
 <dl>
  <dt>format="a"</dt>
  <dd>a b c . . .y z aa ab . . .</dd>
 </dl>
 </dd>
</dl>

<dl>
 <dd>
 <dl>
  <dt>format="A"</dt>
  <dd>A B C . . . Y Z AA AB . . .</dd>
 </dl>
 </dd>
</dl>

<dl>
 <dd>
 <dl>
  <dt>format="i"</dt>
  <dd>i ii iii iv v . . .</dd>
 </dl>
 </dd>
</dl>

<dl>
 <dd>
 <dl>
  <dt>format="I"</dt>
  <dd>I II III IV V . . .</dd>
 </dl>
 </dd>
</dl>

<dl>
 <dt>lang (Not supported at this time.)</dt>
 <dd>Specifies which language's alphabet should be used in letter-based numbering formats.</dd>
</dl>

<dl>
 <dt>letter-value</dt>
 <dd>Disambiguates between numbering sequences that use letters. Some languages have more than one numbering system that use letters. If both systems begin with the same token, ambiguity can arise. This attribute can have the value "<code>alphabetic</code>" or "<code>traditional</code>". The default is "<code>alphabetic</code>".</dd>
</dl>

<dl>
 <dt>grouping-separator</dt>
 <dd>Specifies what character should be used as the group (e.g. thousands) separator. The default is the comma (<code>,</code>).</dd>
</dl>

<dl>
 <dt>grouping-size</dt>
 <dd>Indicates the number of digits that make up a numeric group. The default value is "<code>3</code>".</dd>
</dl>

<h3 id="Type" name="Type">Type</h3>

<p>Instruction, appears within a template.</p>

<h3 id="Defined" name="Defined">Defined</h3>

<p>XSLT, section 7.7</p>

<h3 id="Gecko_support" name="Gecko_support">Gecko support</h3>

<p>Partial support. See comments above.</p>