|
Eneboo - Documentación para desarrolladores
|
#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 xsltFormatToken * | xsltFormatTokenPtr |
| typedef struct _xsltFormat | xsltFormat |
| typedef xsltFormat * | xsltFormatPtr |
Funciones | |
| void | xsltNumberFormat (xsltTransformContextPtr ctxt, xsltNumberDataPtr data, xmlNodePtr node) |
| xmlXPathError | xsltFormatNumberConversion (xsltDecimalFormatPtr self, xmlChar *format, double number, xmlChar **result) |
| #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 | |||
| ) |
((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) |
| typedef struct _xsltFormat xsltFormat |
| typedef xsltFormat* xsltFormatPtr |
| typedef struct _xsltFormatToken xsltFormatToken |
| typedef xsltFormatToken* xsltFormatTokenPtr |
| xmlXPathError xsltFormatNumberConversion | ( | xsltDecimalFormatPtr | self, |
| xmlChar * | format, | ||
| double | number, | ||
| xmlChar ** | result | ||
| ) |
xsltFormatNumberConversion: : the decimal format : the format requested : the value to format
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.
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.
1.7.4