16# define FALSE (0 == 1)
20#define SYMBOL_QUOTE ((xmlChar)'\'')
22#define DEFAULT_TOKEN '0'
23#define DEFAULT_SEPARATOR "."
25#define MAX_TOKENS 1024
91#define IS_SPECIAL(self,letter) \
92 ((xsltUTF8Charcmp((letter), (self)->zeroDigit) == 0) || \
93 (xsltUTF8Charcmp((letter), (self)->digit) == 0) || \
94 (xsltUTF8Charcmp((letter), (self)->decimalPoint) == 0) || \
95 (xsltUTF8Charcmp((letter), (self)->grouping) == 0) || \
96 (xsltUTF8Charcmp((letter), (self)->patternSeparator) == 0))
98#define IS_DIGIT_ZERO(x) xsltIsDigitZero(x)
99#define IS_DIGIT_ONE(x) xsltIsDigitZero((x)-1)
111 case 0x0030:
case 0x0660:
case 0x06F0:
case 0x0966:
112 case 0x09E6:
case 0x0A66:
case 0x0AE6:
case 0x0B66:
113 case 0x0C66:
case 0x0CE6:
case 0x0D66:
case 0x0E50:
114 case 0x0ED0:
case 0x0F20:
127 int groupingCharacter,
128 int groupingCharacterLen)
146 pointer = &temp_string[
sizeof(temp_string)] - 1;
149 while (
pointer > temp_string) {
152 if ((
i > 0) && (groupingCharacter != 0) &&
153 (digitsPerGroup > 0) &&
154 ((
i % digitsPerGroup) == 0)) {
155 if (
pointer - groupingCharacterLen < temp_string) {
159 pointer -= groupingCharacterLen;
191 "xsltNumberFormatDecimal: Internal buffer size exceeded\n");
221 data->digitsPerGroup,
222 data->groupingCharacter,
223 data->groupingCharacterLen);
228 pointer = &temp_string[
sizeof(temp_string)];
232 for (
i = 1;
i < (
int)
sizeof(temp_string);
i++) {
252 if (number < 1.0 || number > 5000.0) {
254 data->digitsPerGroup,
255 data->groupingCharacter,
256 data->groupingCharacterLen);
263 while (
number >= 1000.0) {
380 }
else if ( (
val ==
'A') ||
443 for (
i = 0;
i < numbers_max;
i++) {
445 number = numbers[(numbers_max - 1) -
i];
459 "xsl-number : negative value\n");
463 if (i < tokens->nTokens) {
469 }
else if (tokens->
nTokens > 0) {
492 switch (xmlXPathIsInf(
number)) {
500 if (xmlXPathIsNaN(
number)) {
504 switch (
token->token) {
523 data->digitsPerGroup,
524 data->groupingCharacter,
525 data->groupingCharacterLen);
548 if (countPat !=
NULL) {
594 if ((fromPat !=
NULL) &&
601#ifdef LIBXML_DOCB_ENABLED
646 xmlXPathParserContextPtr
parser;
648 oldCtxtNode =
context->xpathCtxt->node;
654 if ((fromPat !=
NULL) &&
668 context->xpathCtxt->node = ancestor;
669 preceding = xmlXPathNextPrecedingSibling(
parser, ancestor);
670 while (preceding !=
NULL) {
674 context->xpathCtxt->node = ancestor;
676 xmlXPathNextPrecedingSibling(
parser, preceding);
683 ancestor = xmlXPathNextAncestor(
parser, ancestor);
685 xmlXPathFreeParserContext(
parser);
687 context->xpathCtxt->node = oldCtxtNode;
699 xmlXPathObjectPtr
obj;
712 xmlXPathFreeObject(
obj);
744 if (
data->has_format == 0)
757 goto XSLT_NUMBER_FORMAT_END;
775 }
else if (
data->level) {
792 double numarray[1024];
793 int max =
sizeof(numarray)/
sizeof(numarray[0]);
837XSLT_NUMBER_FORMAT_END:
879 if (
info->is_multiplier_set)
881 info->multiplier = 100;
884 if (
info->is_multiplier_set)
886 info->multiplier = 1000;
946 xmlXPathError
status = XPATH_EXPRESSION_OK;
950 int prefix_length, suffix_length = 0, nprefix_length, nsuffix_length;
953 int self_grouping_len;
959 int delayed_multiplier = 0;
961 char default_sign = 0;
963 char found_error = 0;
967 "xsltFormatNumberConversion : "
968 "Invalid format (0-length)\n");
971 switch (xmlXPathIsInf(
number)) {
985 if (xmlXPathIsNaN(
number)) {
996 return XPATH_MEMORY_ERROR;
1015 prefix = the_format;
1017 if (prefix_length < 0) {
1030 while ((*the_format != 0) &&
1034 if (delayed_multiplier != 0) {
1037 delayed_multiplier = 0;
1051 }
else if ((self_grouping_len > 0) &&
1055 the_format += self_grouping_len;
1062 delayed_multiplier = 100;
1068 delayed_multiplier = 1000;
1081 if ( (*the_format != 0) &&
1091 while (*the_format != 0) {
1106 delayed_multiplier = 100;
1118 delayed_multiplier = 1000;
1133 if (delayed_multiplier != 0) {
1135 delayed_multiplier = 0;
1144 if (delayed_multiplier != 0) {
1146 delayed_multiplier = 0;
1149 suffix = the_format;
1151 if ( (suffix_length < 0) ||
1152 ((*the_format != 0) &&
1183 nprefix = the_format;
1186 if (nprefix_length<0) {
1191 while (*the_format != 0) {
1199 delayed_multiplier = 1;
1202 delayed_multiplier = 0;
1211 if (delayed_multiplier != 0) {
1217 if (*the_format != 0) {
1218 nsuffix = the_format;
1221 if (nsuffix_length < 0) {
1228 if (*the_format != 0) {
1236 if ((nprefix_length != prefix_length) ||
1237 (nsuffix_length != suffix_length) ||
1238 ((nprefix_length > 0) &&
1239 (
xmlStrncmp(nprefix, prefix, prefix_length) !=0 )) ||
1240 ((nsuffix_length > 0) &&
1241 (
xmlStrncmp(nsuffix, suffix, suffix_length) !=0 ))) {
1243 prefix_length = nprefix_length;
1245 suffix_length = nsuffix_length;
1254 if (found_error != 0) {
1256 "xsltFormatNumberConversion : "
1257 "error in format string '%s', using default\n",
format);
1258 default_sign = (
number < 0.0) ? 1 : 0;
1259 prefix_length = suffix_length = 0;
1270 if (default_sign != 0)
1274 for (
j = 0;
j < prefix_length; ) {
1339 for (
j = 0;
j < suffix_length; ) {
static char alpha_lower_list[]
static int xsltTestCompMatchCount(xsltTransformContextPtr context, xmlNodePtr node, xsltCompMatchPtr countPat, xmlNodePtr cur)
static void xsltNumberFormatInsertNumbers(xsltNumberDataPtr data, double *numbers, int numbers_max, xsltFormatPtr tokens, xmlBufferPtr buffer)
static int xsltNumberFormatGetMultipleLevel(xsltTransformContextPtr context, xmlNodePtr node, xsltCompMatchPtr countPat, xsltCompMatchPtr fromPat, double *array, int max)
static char alpha_upper_list[]
static xsltFormatToken default_token
static int xsltNumberFormatGetValue(xmlXPathContextPtr context, xmlNodePtr node, const xmlChar *value, double *number)
static int xsltIsDigitZero(unsigned int ch)
static void xsltNumberFormatDecimal(xmlBufferPtr buffer, double number, int digit_zero, int width, int digitsPerGroup, int groupingCharacter, int groupingCharacterLen)
xsltFormat * xsltFormatPtr
static void xsltNumberFormatRoman(xsltNumberDataPtr data, xmlBufferPtr buffer, double number, int is_upper)
xmlXPathError xsltFormatNumberConversion(xsltDecimalFormatPtr self, xmlChar *format, double number, xmlChar **result)
static int xsltIsLetterDigit(int val)
xsltFormatToken * xsltFormatTokenPtr
#define DEFAULT_SEPARATOR
#define IS_SPECIAL(self, letter)
static void xsltNumberFormatTokenize(const xmlChar *format, xsltFormatPtr tokens)
static int xsltUTF8Charcmp(xmlChar *utf1, xmlChar *utf2)
static int xsltNumberFormatGetAnyLevel(xsltTransformContextPtr context, xmlNodePtr node, xsltCompMatchPtr countPat, xsltCompMatchPtr fromPat, double *array)
static int xsltFormatNumberPreSuffix(xsltDecimalFormatPtr self, xmlChar **format, xsltFormatNumberInfoPtr info)
static void xsltNumberFormatAlpha(xsltNumberDataPtr data, xmlBufferPtr buffer, double number, int is_upper)
void xsltNumberFormat(xsltTransformContextPtr ctxt, xsltNumberDataPtr data, xmlNodePtr node)
#define xmlIsIdeographicQ(c)
#define xmlIsBaseCharQ(c)
int xsltTestCompMatchList(xsltTransformContextPtr ctxt, xmlNodePtr node, xsltCompMatchPtr comp)
void xsltCompMatchClearCache(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
double pow(double x, double y)
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei width
GLenum GLenum GLenum GLenum GLenum scale
GLsizei const GLvoid * pointer
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)
_Check_return_ double __cdecl fmod(_In_ double x, _In_ double y)
_Check_return_ _CRTIMP double __cdecl floor(_In_ double x)
#define memcpy(s1, s2, n)
static unsigned int number
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
XMLPUBFUN int XMLCALL xmlStringCurrentChar(xmlParserCtxtPtr ctxt, const xmlChar *cur, int *len)
XMLPUBFUN int XMLCALL xmlCopyCharMultiByte(xmlChar *out, int val)
static unsigned __int64 next
XMLPUBVAR xmlFreeFunc xmlFree
XMLPUBFUN void XMLCALL xmlBufferFree(xmlBufferPtr buf)
XMLPUBFUN int XMLCALL xmlBufferAdd(xmlBufferPtr buf, const xmlChar *str, int len)
#define XML_DOCB_DOCUMENT_NODE
XMLPUBFUN int XMLCALL xmlBufferCCat(xmlBufferPtr buf, const char *str)
XMLPUBFUN xmlBufferPtr XMLCALL xmlBufferCreate(void)
XMLPUBFUN const xmlChar *XMLCALL xmlBufferContent(const xmlBuffer *buf)
XMLPUBFUN int XMLCALL xmlBufferCat(xmlBufferPtr buf, const xmlChar *str)
xmlXPathContextPtr xpathCtxt
xmlChar * xsltEvalAttrValueTemplate(xsltTransformContextPtr ctxt, xmlNodePtr inst, const xmlChar *name, const xmlChar *ns)
XMLPUBFUN const xmlChar *XMLCALL xmlUTF8Strpos(const xmlChar *utf, int pos)
XMLPUBFUN xmlChar *XMLCALL xmlStrndup(const xmlChar *cur, int len)
XMLPUBFUN xmlChar *XMLCALL xmlStrcat(xmlChar *cur, const xmlChar *add)
XMLPUBFUN int XMLCALL xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len)
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
XMLPUBFUN int XMLCALL xmlUTF8Strsize(const xmlChar *utf, int len)
XMLPUBFUN int XMLCALL xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar)
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN int XMLCALL xmlStrlen(const xmlChar *str)
void xsltTransformError(xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node, const char *msg,...)
xmlGenericErrorFunc xsltGenericError
int xsltGetUTF8Char(const unsigned char *utf, int *len)
void * xsltGenericErrorContext