Eneboo - Documentación para desarrolladores
Clases | 'defines' | 'typedefs' | Funciones
Referencia del Archivo src/libxslt/libxslt/numbers.c
#include "libxslt.h"
#include <math.h>
#include <limits.h>
#include <float.h>
#include <string.h>
#include <libxml/xmlmemory.h>
#include <libxml/parserInternals.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include <libxml/encoding.h>
#include "xsltutils.h"
#include "pattern.h"
#include "templates.h"
#include "transform.h"
#include "numbersInternals.h"

Clases

struct  _xsltFormatToken
struct  _xsltFormat

'defines'

#define IN_LIBXSLT
#define FALSE   (0 == 1)
#define TRUE   (1 == 1)
#define SYMBOL_QUOTE   ((xmlChar)'\'')
#define DEFAULT_TOKEN   (xmlChar)'0'
#define DEFAULT_SEPARATOR   "."
#define MAX_TOKENS   1024
#define IS_SPECIAL(self, letter)
#define IS_DIGIT_ZERO(x)   xsltIsDigitZero(x)
#define IS_DIGIT_ONE(x)   xsltIsDigitZero((xmlChar)(x)-1)

'typedefs'

typedef struct _xsltFormatToken xsltFormatToken
typedef xsltFormatTokenxsltFormatTokenPtr
typedef struct _xsltFormat xsltFormat
typedef xsltFormatxsltFormatPtr

Funciones

void xsltNumberFormat (xsltTransformContextPtr ctxt, xsltNumberDataPtr data, xmlNodePtr node)
xmlXPathError xsltFormatNumberConversion (xsltDecimalFormatPtr self, xmlChar *format, double number, xmlChar **result)

Documentación de los 'defines'

#define DEFAULT_SEPARATOR   "."
#define DEFAULT_TOKEN   (xmlChar)'0'
#define FALSE   (0 == 1)
#define IN_LIBXSLT
#define IS_DIGIT_ONE (   x)    xsltIsDigitZero((xmlChar)(x)-1)
#define IS_DIGIT_ZERO (   x)    xsltIsDigitZero(x)
#define IS_SPECIAL (   self,
  letter 
)
Valor:
((xsltUTF8Charcmp((letter), (self)->zeroDigit) == 0)        ||  \
     (xsltUTF8Charcmp((letter), (self)->digit) == 0)        ||  \
     (xsltUTF8Charcmp((letter), (self)->decimalPoint) == 0)  || \
     (xsltUTF8Charcmp((letter), (self)->grouping) == 0)     ||  \
     (xsltUTF8Charcmp((letter), (self)->patternSeparator) == 0))
#define MAX_TOKENS   1024
#define SYMBOL_QUOTE   ((xmlChar)'\'')
#define TRUE   (1 == 1)

Documentación de los 'typedefs'

typedef struct _xsltFormat xsltFormat

Documentación de las funciones

xmlXPathError xsltFormatNumberConversion ( xsltDecimalFormatPtr  self,
xmlChar format,
double  number,
xmlChar **  result 
)

xsltFormatNumberConversion: : the decimal format : the format requested : the value to format

Devuelve:
: the place to ouput the result

format-number() uses the JDK 1.1 DecimalFormat class:

http://java.sun.com/products/jdk/1.1/docs/api/java.text.DecimalFormat.html

Structure:

pattern := subpattern{;subpattern} subpattern := {prefix}integer{.fraction}{suffix} prefix := '\u0000'..'\uFFFD' - specialCharacters suffix := '\u0000'..'\uFFFD' - specialCharacters integer := '#'* '0'* '0' fraction := '0'* '#'*

Notation: X* 0 or more instances of X (X | Y) either X or Y. X..Y any character from X up to Y, inclusive. S - T characters in S, except those in T

Special Characters:

Symbol Meaning 0 a digit # a digit, zero shows as absent . placeholder for decimal separator , placeholder for grouping separator. ; separates formats.

  • default negative prefix. % multiply by 100 and show as percentage ? multiply by 1000 and show as per mille X any other characters can be used in the prefix or suffix ' used to quote special characters in a prefix or suffix.

Returns a possible XPath error

void xsltNumberFormat ( xsltTransformContextPtr  ctxt,
xsltNumberDataPtr  data,
xmlNodePtr  node 
)

xsltNumberFormat: : the XSLT transformation context : the formatting informations : the data to format

Convert one number.

 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'