Tutorial XML

INICIO XML Introducción XML XML Cómo utilizar Árbol XML Sintaxis XML Elementos XML Atributos XML Espacios de nombres XML Pantalla XML Solicitud Http XML Analizador XML DOM XML XPath XML XML XSLT XQuery XML Enlace X XML Validador XML DTD XML Esquema XML Servidor XML Ejemplos XML Cuestionario XML Certificado XML

XML-AJAX

AJAX Introducción AJAX XMLHttp Solicitud AJAX Respuesta AJAX Archivo XML AJAX AJAXPHP Ajax ASP Base de datos AJAX Aplicaciones AJAX Ejemplos de AJAX

DOM XML

DOM Introducción Nodos DOM Acceso DOM Información del nodo DOM Lista de nodos DOM Atravesando DOM Navegación DOM DOM obtener valores Nodos de cambio de DOM Eliminar nodos DOM Nodos de reemplazo de DOM DOM Crear nodos Agregar nodos DOM Nodos de clonación de DOM Ejemplos de DOM

Tutorial XPath

Introducción a XPath Nodos XPath Sintaxis XPath Ejes XPath Operadores XPath Ejemplos de XPath

Tutorial XSLT

XSLT Introducción Idiomas XSL Transformación XSLT XSLT <plantilla> XSLT <valor-de> XSLT <para-cada> XSLT <ordenar> XSLT <si> XSLT <elegir> Aplicar XSLT XSLT en el cliente XSLT en el servidor XSLT Editar XML Ejemplos de XSLT

Tutorial de XQuery

Introducción a XQuery Ejemplo de XQuery XQuery FLWOR XQuery HTML Términos de XQuery Sintaxis XQuery XQuery Agregar Seleccionar XQuery Funciones XQuery

DTD XML

Introducción a DTD Bloques de construcción DTD Elementos DTD Atributos DTD Elementos DTD vs Attr Entidades DTD Ejemplos de DTD

Esquema XSD

XSD Introducción XSD Cómo XSD <esquema> Elementos XSD Atributos XSD Restricciones XSD

Complejo XSD

Elementos XSD XSD vacío Solo elementos XSD Solo texto XSD XSD mixto Indicadores XSD XSD <cualquiera> XSD <cualquieratributo> Sustitución XSD Ejemplo XSD

Datos XSD

Cadena XSD Fecha XSD XSD Numérico Miscelánea XSD Referencia XSD

Servicios Web

Servicios XML XML WSDL JABÓN XML XML RDF RSS XML

Referencias

Tipos de nodos DOM Nodo DOM Lista de nodos DOM DOM NamedNodeMap Documento DOM Elemento DOM Atributo DOM Texto DOM DOM CDATA Comentario DOM DOM XMLHttpSolicitud Analizador DOM Elementos XSLT Funciones XSLT/XPath

XSLT <xsl:número>


❮ Referencia completa del elemento XSLT

Definición y uso

El elemento <xsl:number> se utiliza para determinar la posición del número entero del nodo actual en el origen. También se utiliza para dar formato a un número.


Sintaxis

<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"/>

Atributos

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

Ejemplo 1

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

Output:

250.000

Ejemplo 2

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

Output:

25,00,00

Ejemplo 3

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

Output:

X#I#I

Ejemplo 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>

❮ Referencia completa del elemento XSLT