mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-08-07 10:42:55 +03:00
Big space and tabs cleanup
Remove spaces followed by tabs, and space and tabs at the end of lines
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* xsltICUSort.c: module provided by Richard Jinks to provide a
|
||||
* xsltICUSort.c: module provided by Richard Jinks to provide a
|
||||
* sort function replacement using ICU, it is not
|
||||
* included in standard due to the size of the ICU
|
||||
* library
|
||||
@@ -136,8 +136,8 @@ xsltICUSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
|
||||
conv = ucnv_open("UTF8", &status);
|
||||
if(U_FAILURE(status)) {
|
||||
xsltTransformError(ctxt, NULL, NULL, "xsltICUSortFunction: Error opening converter\n");
|
||||
}
|
||||
if(comp->has_lang)
|
||||
}
|
||||
if(comp->has_lang)
|
||||
coll = ucol_open(comp->lang, &status);
|
||||
if(U_FAILURE(status) || !comp->has_lang) {
|
||||
status = U_ZERO_ERROR;
|
||||
@@ -146,9 +146,9 @@ xsltICUSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
|
||||
if(U_FAILURE(status)) {
|
||||
xsltTransformError(ctxt, NULL, NULL, "xsltICUSortFunction: Error opening collator\n");
|
||||
}
|
||||
if(comp->lower_first)
|
||||
if(comp->lower_first)
|
||||
ucol_setAttribute(coll,UCOL_CASE_FIRST,UCOL_LOWER_FIRST,&status);
|
||||
else
|
||||
else
|
||||
ucol_setAttribute(coll,UCOL_CASE_FIRST,UCOL_UPPER_FIRST,&status);
|
||||
if(U_FAILURE(status)) {
|
||||
xsltTransformError(ctxt, NULL, NULL, "xsltICUSortFunction: Error setting collator attribute\n");
|
||||
@@ -161,7 +161,7 @@ xsltICUSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
|
||||
j = i - incr;
|
||||
if (results[i] == NULL)
|
||||
continue;
|
||||
|
||||
|
||||
while (j >= 0) {
|
||||
if (results[j] == NULL)
|
||||
tst = 1;
|
||||
@@ -169,7 +169,7 @@ xsltICUSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
|
||||
if (number) {
|
||||
if (results[j]->floatval == results[j + incr]->floatval)
|
||||
tst = 0;
|
||||
else if (results[j]->floatval >
|
||||
else if (results[j]->floatval >
|
||||
results[j + incr]->floatval)
|
||||
tst = 1;
|
||||
else tst = -1;
|
||||
@@ -207,11 +207,11 @@ xsltICUSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
|
||||
* Compute the result of the next level for the
|
||||
* full set, this might be optimized ... or not
|
||||
*/
|
||||
if (resultsTab[depth] == NULL)
|
||||
if (resultsTab[depth] == NULL)
|
||||
resultsTab[depth] = xsltComputeSortResult(ctxt,
|
||||
sorts[depth]);
|
||||
res = resultsTab[depth];
|
||||
if (res == NULL)
|
||||
if (res == NULL)
|
||||
break;
|
||||
if (res[j] == NULL)
|
||||
tst = 1;
|
||||
@@ -219,7 +219,7 @@ xsltICUSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
|
||||
if (numb) {
|
||||
if (res[j]->floatval == res[j + incr]->floatval)
|
||||
tst = 0;
|
||||
else if (res[j]->floatval >
|
||||
else if (res[j]->floatval >
|
||||
res[j + incr]->floatval)
|
||||
tst = 1;
|
||||
else tst = -1;
|
||||
|
@@ -46,16 +46,16 @@ exsltNodeSetFunction (xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
if (fragment == NULL) {
|
||||
xsltTransformError(tctxt, NULL, tctxt->inst,
|
||||
"exsltNodeSetFunction: Failed to create a tree fragment.\n");
|
||||
tctxt->state = XSLT_STATE_STOPPED;
|
||||
tctxt->state = XSLT_STATE_STOPPED;
|
||||
return;
|
||||
}
|
||||
xsltRegisterLocalRVT(tctxt, fragment);
|
||||
|
||||
strval = xmlXPathPopString (ctxt);
|
||||
|
||||
|
||||
txt = xmlNewDocText (fragment, strval);
|
||||
xmlAddChild((xmlNodePtr) fragment, txt);
|
||||
obj = xmlXPathNewNodeSet(txt);
|
||||
obj = xmlXPathNewNodeSet(txt);
|
||||
if (obj == NULL) {
|
||||
xsltTransformError(tctxt, NULL, tctxt->inst,
|
||||
"exsltNodeSetFunction: Failed to create a node set object.\n");
|
||||
@@ -69,7 +69,7 @@ exsltNodeSetFunction (xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
}
|
||||
if (strval != NULL)
|
||||
xmlFree (strval);
|
||||
|
||||
|
||||
valuePush (ctxt, obj);
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#define MD5_DIGEST_LENGTH 16
|
||||
#define SHA1_DIGEST_LENGTH 20
|
||||
|
||||
/* gcrypt rc4 can do 256 bit keys, but cryptoapi limit
|
||||
/* gcrypt rc4 can do 256 bit keys, but cryptoapi limit
|
||||
seems to be 128 for the default provider */
|
||||
#define RC4_KEY_LENGTH 128
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
* @hex: buffer to store hex version of blob
|
||||
* @hexlen: length of buffer to store hex version of blob
|
||||
*
|
||||
* Helper function which encodes a binary blob as hex.
|
||||
* Helper function which encodes a binary blob as hex.
|
||||
*/
|
||||
static void
|
||||
exsltCryptoBin2Hex (const unsigned char *bin, int binlen,
|
||||
@@ -357,7 +357,7 @@ exsltCryptoGcryptInit (void) {
|
||||
* @msglen: length of text to be hashed
|
||||
* @dest: buffer to place hash result
|
||||
*
|
||||
* Helper function which hashes a message using MD4, MD5, or SHA1.
|
||||
* Helper function which hashes a message using MD4, MD5, or SHA1.
|
||||
* using gcrypt
|
||||
*/
|
||||
static void
|
||||
|
128
libexslt/date.c
128
libexslt/date.c
@@ -99,7 +99,7 @@ typedef struct _exsltDateValDuration exsltDateValDuration;
|
||||
typedef exsltDateValDuration *exsltDateValDurationPtr;
|
||||
struct _exsltDateValDuration {
|
||||
long mon; /* mon stores years also */
|
||||
long day;
|
||||
long day;
|
||||
double sec; /* sec stores min and hour also */
|
||||
};
|
||||
|
||||
@@ -119,7 +119,7 @@ struct _exsltDateVal {
|
||||
* *
|
||||
****************************************************************/
|
||||
|
||||
#if defined(HAVE_TIME_H) \
|
||||
#if defined(HAVE_TIME_H) \
|
||||
&& (defined(HAVE_LOCALTIME) || defined(HAVE_LOCALTIME_R)) \
|
||||
&& (defined(HAVE_GMTIME) || defined(HAVE_GMTIME_R)) \
|
||||
&& defined(HAVE_TIME)
|
||||
@@ -791,27 +791,27 @@ exsltDateCurrent (void)
|
||||
local_s = localTm.tm_hour * SECS_PER_HOUR +
|
||||
localTm.tm_min * SECS_PER_MIN +
|
||||
localTm.tm_sec;
|
||||
|
||||
|
||||
gm_s = gmTm.tm_hour * SECS_PER_HOUR +
|
||||
gmTm.tm_min * SECS_PER_MIN +
|
||||
gmTm.tm_sec;
|
||||
|
||||
|
||||
if (localTm.tm_year < gmTm.tm_year) {
|
||||
ret->value.date.tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
|
||||
ret->value.date.tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
|
||||
} else if (localTm.tm_year > gmTm.tm_year) {
|
||||
ret->value.date.tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
|
||||
ret->value.date.tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
|
||||
} else if (localTm.tm_mon < gmTm.tm_mon) {
|
||||
ret->value.date.tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
|
||||
ret->value.date.tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
|
||||
} else if (localTm.tm_mon > gmTm.tm_mon) {
|
||||
ret->value.date.tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
|
||||
ret->value.date.tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
|
||||
} else if (localTm.tm_mday < gmTm.tm_mday) {
|
||||
ret->value.date.tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
|
||||
ret->value.date.tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
|
||||
} else if (localTm.tm_mday > gmTm.tm_mday) {
|
||||
ret->value.date.tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
|
||||
ret->value.date.tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
|
||||
} else {
|
||||
ret->value.date.tzo = (local_s - gm_s)/60;
|
||||
ret->value.date.tzo = (local_s - gm_s)/60;
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
@@ -1111,9 +1111,9 @@ exsltDateFormatDuration (const exsltDateValDurationPtr dt)
|
||||
return NULL;
|
||||
|
||||
/* quick and dirty check */
|
||||
if ((dt->sec == 0.0) && (dt->day == 0) && (dt->mon == 0))
|
||||
if ((dt->sec == 0.0) && (dt->day == 0) && (dt->mon == 0))
|
||||
return xmlStrdup((xmlChar*)"P0D");
|
||||
|
||||
|
||||
secs = dt->sec;
|
||||
days = (double)dt->day;
|
||||
years = (double)(dt->mon / 12);
|
||||
@@ -1123,15 +1123,15 @@ exsltDateFormatDuration (const exsltDateValDurationPtr dt)
|
||||
if (secs < 0.0) {
|
||||
secs = -secs;
|
||||
*cur = '-';
|
||||
}
|
||||
}
|
||||
if (days < 0) {
|
||||
days = -days;
|
||||
*cur = '-';
|
||||
}
|
||||
}
|
||||
if (years < 0) {
|
||||
years = -years;
|
||||
*cur = '-';
|
||||
}
|
||||
}
|
||||
if (months < 0) {
|
||||
months = -months;
|
||||
*cur = '-';
|
||||
@@ -1301,7 +1301,7 @@ exsltDateFormat (const exsltDateValPtr dt)
|
||||
* _exsltDateCastYMToDays:
|
||||
* @dt: an #exsltDateValPtr
|
||||
*
|
||||
* Convert mon and year of @dt to total number of days. Take the
|
||||
* Convert mon and year of @dt to total number of days. Take the
|
||||
* number of years since (or before) 1 AD and add the number of leap
|
||||
* years. This is a function because negative
|
||||
* years must be handled a little differently and there is no zero year.
|
||||
@@ -1414,7 +1414,7 @@ _exsltDateTruncateDate (exsltDateValPtr dt, exsltDateType type)
|
||||
* @yr: year
|
||||
*
|
||||
* Determine the day-in-week from @yday and @yr. 0001-01-01 was
|
||||
* a Monday so all other days are calculated from there. Take the
|
||||
* a Monday so all other days are calculated from there. Take the
|
||||
* number of years since (or before) add the number of leap years and
|
||||
* the day-in-year and mod by 7. This is a function because negative
|
||||
* years must be handled a little differently and there is no zero year.
|
||||
@@ -1428,7 +1428,7 @@ _exsltDateDayInWeek(long yday, long yr)
|
||||
|
||||
if (yr < 0) {
|
||||
ret = ((yr + (((yr+1)/4)-((yr+1)/100)+((yr+1)/400)) + yday) % 7);
|
||||
if (ret < 0)
|
||||
if (ret < 0)
|
||||
ret += 7;
|
||||
} else
|
||||
ret = (((yr-1) + (((yr-1)/4)-((yr-1)/100)+((yr-1)/400)) + yday) % 7);
|
||||
@@ -1542,7 +1542,7 @@ _exsltDateAdd (exsltDateValPtr dt, exsltDateValPtr dur)
|
||||
if (tyr == 0)
|
||||
tyr--;
|
||||
/*
|
||||
* Coverity detected an overrun in daysInMonth
|
||||
* Coverity detected an overrun in daysInMonth
|
||||
* of size 12 at position 12 with index variable "((r)->mon - 1)"
|
||||
*/
|
||||
if (tmon < 0)
|
||||
@@ -1567,7 +1567,7 @@ _exsltDateAdd (exsltDateValPtr dt, exsltDateValPtr dur)
|
||||
r->year++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
r->day = tempdays;
|
||||
|
||||
/*
|
||||
@@ -1642,7 +1642,7 @@ _exsltDateDifference (exsltDateValPtr x, exsltDateValPtr y, int flag)
|
||||
return NULL;
|
||||
|
||||
if (((x->type < XS_GYEAR) || (x->type > XS_DATETIME)) ||
|
||||
((y->type < XS_GYEAR) || (y->type > XS_DATETIME)))
|
||||
((y->type < XS_GYEAR) || (y->type > XS_DATETIME)))
|
||||
return NULL;
|
||||
|
||||
exsltDateNormalize(x);
|
||||
@@ -1779,7 +1779,7 @@ _exsltDateAddDuration (exsltDateValPtr x, exsltDateValPtr y)
|
||||
*
|
||||
* Implements the EXSLT - Dates and Times date-time() function:
|
||||
* string date:date-time()
|
||||
*
|
||||
*
|
||||
* Returns the current date and time as a date/time string.
|
||||
*/
|
||||
static xmlChar *
|
||||
@@ -1805,7 +1805,7 @@ exsltDateDateTime (void)
|
||||
*
|
||||
* Implements the EXSLT - Dates and Times date() function:
|
||||
* string date:date (string?)
|
||||
*
|
||||
*
|
||||
* Returns the date specified in the date/time string given as the
|
||||
* argument. If no argument is given, then the current local
|
||||
* date/time, as returned by date:date-time is used as a default
|
||||
@@ -1849,7 +1849,7 @@ exsltDateDate (const xmlChar *dateTime)
|
||||
*
|
||||
* Implements the EXSLT - Dates and Times time() function:
|
||||
* string date:time (string?)
|
||||
*
|
||||
*
|
||||
* Returns the time specified in the date/time string given as the
|
||||
* argument. If no argument is given, then the current local
|
||||
* date/time, as returned by date:date-time is used as a default
|
||||
@@ -2630,7 +2630,7 @@ exsltDateMinuteInHour (const xmlChar *dateTime)
|
||||
* - xs:time (hh:mm:ss)
|
||||
* If the date/time string is not in one of these formats, then NaN is
|
||||
* returned.
|
||||
*
|
||||
*
|
||||
* Returns the second or NaN.
|
||||
*/
|
||||
static double
|
||||
@@ -2667,21 +2667,21 @@ exsltDateSecondInMinute (const xmlChar *dateTime)
|
||||
* @ystr: date/time string
|
||||
*
|
||||
* Implements the date:add (string,string) function which returns the
|
||||
* date/time * resulting from adding a duration to a date/time.
|
||||
* date/time * resulting from adding a duration to a date/time.
|
||||
* The first argument (@xstr) must be right-truncated date/time
|
||||
* strings in one of the formats defined in [XML Schema Part 2:
|
||||
* Datatypes]. The permitted formats are as follows:
|
||||
* - xs:dateTime (CCYY-MM-DDThh:mm:ss)
|
||||
* - xs:date (CCYY-MM-DD)
|
||||
* - xs:gYearMonth (CCYY-MM)
|
||||
* - xs:gYear (CCYY)
|
||||
* Datatypes]. The permitted formats are as follows:
|
||||
* - xs:dateTime (CCYY-MM-DDThh:mm:ss)
|
||||
* - xs:date (CCYY-MM-DD)
|
||||
* - xs:gYearMonth (CCYY-MM)
|
||||
* - xs:gYear (CCYY)
|
||||
* The second argument (@ystr) is a string in the format defined for
|
||||
* xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes].
|
||||
* xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes].
|
||||
* The return value is a right-truncated date/time strings in one of
|
||||
* the formats defined in [XML Schema Part 2: Datatypes] and listed
|
||||
* above. This value is calculated using the algorithm described in
|
||||
* [Appendix E Adding durations to dateTimes] of [XML Schema Part 2:
|
||||
* Datatypes].
|
||||
* Datatypes].
|
||||
|
||||
* Returns date/time string or NULL.
|
||||
*/
|
||||
@@ -2689,7 +2689,7 @@ static xmlChar *
|
||||
exsltDateAdd (const xmlChar *xstr, const xmlChar *ystr)
|
||||
{
|
||||
exsltDateValPtr dt, dur, res;
|
||||
xmlChar *ret;
|
||||
xmlChar *ret;
|
||||
|
||||
if ((xstr == NULL) || (ystr == NULL))
|
||||
return NULL;
|
||||
@@ -2728,18 +2728,18 @@ exsltDateAdd (const xmlChar *xstr, const xmlChar *ystr)
|
||||
* @ystr: second duration string
|
||||
*
|
||||
* Implements the date:add-duration (string,string) function which returns
|
||||
* the duration resulting from adding two durations together.
|
||||
* the duration resulting from adding two durations together.
|
||||
* Both arguments are strings in the format defined for xs:duration
|
||||
* in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. If either
|
||||
* argument is not in this format, the function returns an empty string
|
||||
* ('').
|
||||
* ('').
|
||||
* The return value is a string in the format defined for xs:duration
|
||||
* in [3.2.6 duration] of [XML Schema Part 2: Datatypes].
|
||||
* in [3.2.6 duration] of [XML Schema Part 2: Datatypes].
|
||||
* The durations can usually be added by summing the numbers given for
|
||||
* each of the components in the durations. However, if the durations
|
||||
* are differently signed, then this sometimes results in durations
|
||||
* that are impossible to express in this syntax (e.g. 'P1M' + '-P1D').
|
||||
* In these cases, the function returns an empty string ('').
|
||||
* In these cases, the function returns an empty string ('').
|
||||
*
|
||||
* Returns duration string or NULL.
|
||||
*/
|
||||
@@ -2747,7 +2747,7 @@ static xmlChar *
|
||||
exsltDateAddDuration (const xmlChar *xstr, const xmlChar *ystr)
|
||||
{
|
||||
exsltDateValPtr x, y, res;
|
||||
xmlChar *ret;
|
||||
xmlChar *ret;
|
||||
|
||||
if ((xstr == NULL) || (ystr == NULL))
|
||||
return NULL;
|
||||
@@ -2780,18 +2780,18 @@ exsltDateAddDuration (const xmlChar *xstr, const xmlChar *ystr)
|
||||
* exsltDateSumFunction:
|
||||
* @ns: a node set of duration strings
|
||||
*
|
||||
* The date:sum function adds a set of durations together.
|
||||
* The string values of the nodes in the node set passed as an argument
|
||||
* are interpreted as durations and added together as if using the
|
||||
* The date:sum function adds a set of durations together.
|
||||
* The string values of the nodes in the node set passed as an argument
|
||||
* are interpreted as durations and added together as if using the
|
||||
* date:add-duration function. (from exslt.org)
|
||||
*
|
||||
* The return value is a string in the format defined for xs:duration
|
||||
* in [3.2.6 duration] of [XML Schema Part 2: Datatypes].
|
||||
* in [3.2.6 duration] of [XML Schema Part 2: Datatypes].
|
||||
* The durations can usually be added by summing the numbers given for
|
||||
* each of the components in the durations. However, if the durations
|
||||
* are differently signed, then this sometimes results in durations
|
||||
* that are impossible to express in this syntax (e.g. 'P1M' + '-P1D').
|
||||
* In these cases, the function returns an empty string ('').
|
||||
* In these cases, the function returns an empty string ('').
|
||||
*
|
||||
* Returns duration string or NULL.
|
||||
*/
|
||||
@@ -2835,7 +2835,7 @@ exsltDateSumFunction (xmlXPathParserContextPtr ctxt, int nargs)
|
||||
}
|
||||
|
||||
for (i = 0; i < ns->nodeNr; i++) {
|
||||
int result;
|
||||
int result;
|
||||
tmp = xmlXPathCastNodeToString (ns->nodeTab[i]);
|
||||
if (tmp == NULL) {
|
||||
xmlXPathFreeNodeSet (ns);
|
||||
@@ -2888,13 +2888,13 @@ exsltDateSumFunction (xmlXPathParserContextPtr ctxt, int nargs)
|
||||
* local date/time, as returned by exsltDateCurrent() is used as the
|
||||
* default argument. If the date/time string is a xs:duration, then the
|
||||
* years and months must be zero (or not present). Parsing a duration
|
||||
* converts the fields to seconds. If the date/time string is not a
|
||||
* converts the fields to seconds. If the date/time string is not a
|
||||
* duration (and not null), then the legal formats are:
|
||||
* - xs:dateTime (CCYY-MM-DDThh:mm:ss)
|
||||
* - xs:date (CCYY-MM-DD)
|
||||
* - xs:gYearMonth (CCYY-MM)
|
||||
* - xs:gYear (CCYY)
|
||||
* In these cases the difference between the @dateTime and
|
||||
* In these cases the difference between the @dateTime and
|
||||
* 1970-01-01T00:00:00Z is calculated and converted to seconds.
|
||||
*
|
||||
* Note that there was some confusion over whether "difference" meant
|
||||
@@ -2942,7 +2942,7 @@ exsltDateSeconds (const xmlChar *dateTime)
|
||||
|
||||
dur = _exsltDateDifference(y, dt, 1);
|
||||
if (dur != NULL) {
|
||||
ret = exsltDateCastDateToNumber(dur);
|
||||
ret = exsltDateCastDateToNumber(dur);
|
||||
exsltDateFreeDate(dur);
|
||||
}
|
||||
exsltDateFreeDate(y);
|
||||
@@ -2970,26 +2970,26 @@ exsltDateSeconds (const xmlChar *dateTime)
|
||||
* 2: Datatypes]. The date/time with the most specific format (i.e. the
|
||||
* least truncation) is converted into the same format as the date with
|
||||
* the least specific format (i.e. the most truncation). The permitted
|
||||
* formats are as follows, from most specific to least specific:
|
||||
* - xs:dateTime (CCYY-MM-DDThh:mm:ss)
|
||||
* - xs:date (CCYY-MM-DD)
|
||||
* - xs:gYearMonth (CCYY-MM)
|
||||
* - xs:gYear (CCYY)
|
||||
* formats are as follows, from most specific to least specific:
|
||||
* - xs:dateTime (CCYY-MM-DDThh:mm:ss)
|
||||
* - xs:date (CCYY-MM-DD)
|
||||
* - xs:gYearMonth (CCYY-MM)
|
||||
* - xs:gYear (CCYY)
|
||||
* If either of the arguments is not in one of these formats,
|
||||
* date:difference returns the empty string ('').
|
||||
* date:difference returns the empty string ('').
|
||||
* The difference between the date/times is returned as a string in the
|
||||
* format defined for xs:duration in [3.2.6 duration] of [XML Schema
|
||||
* Part 2: Datatypes].
|
||||
* Part 2: Datatypes].
|
||||
* If the date/time string with the least specific format is in either
|
||||
* xs:gYearMonth or xs:gYear format, then the number of days, hours,
|
||||
* minutes and seconds in the duration string must be equal to zero.
|
||||
* (The format of the string will be PnYnM.) The number of months
|
||||
* specified in the duration must be less than 12.
|
||||
* specified in the duration must be less than 12.
|
||||
* Otherwise, the number of years and months in the duration string
|
||||
* must be equal to zero. (The format of the string will be
|
||||
* PnDTnHnMnS.) The number of seconds specified in the duration string
|
||||
* must be less than 60; the number of minutes must be less than 60;
|
||||
* the number of hours must be less than 24.
|
||||
* the number of hours must be less than 24.
|
||||
*
|
||||
* Returns duration string or NULL.
|
||||
*/
|
||||
@@ -2997,7 +2997,7 @@ static xmlChar *
|
||||
exsltDateDifference (const xmlChar *xstr, const xmlChar *ystr)
|
||||
{
|
||||
exsltDateValPtr x, y, dur;
|
||||
xmlChar *ret = NULL;
|
||||
xmlChar *ret = NULL;
|
||||
|
||||
if ((xstr == NULL) || (ystr == NULL))
|
||||
return NULL;
|
||||
@@ -3040,16 +3040,16 @@ exsltDateDifference (const xmlChar *xstr, const xmlChar *ystr)
|
||||
* Implements the The date:duration function returns a duration string
|
||||
* representing the number of seconds specified by the argument string.
|
||||
* If no argument is given, then the result of calling date:seconds
|
||||
* without any arguments is used as a default argument.
|
||||
* without any arguments is used as a default argument.
|
||||
* The duration is returned as a string in the format defined for
|
||||
* xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes].
|
||||
* xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes].
|
||||
* The number of years and months in the duration string must be equal
|
||||
* to zero. (The format of the string will be PnDTnHnMnS.) The number
|
||||
* of seconds specified in the duration string must be less than 60;
|
||||
* the number of minutes must be less than 60; the number of hours must
|
||||
* be less than 24.
|
||||
* be less than 24.
|
||||
* If the argument is Infinity, -Infinity or NaN, then date:duration
|
||||
* returns an empty string ('').
|
||||
* returns an empty string ('').
|
||||
*
|
||||
* Returns duration string or NULL.
|
||||
*/
|
||||
|
@@ -74,11 +74,11 @@ exsltDynEvaluateFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
ret = xmlXPathEval(str,ctxt->context);
|
||||
if (ret)
|
||||
valuePush(ctxt,ret);
|
||||
else {
|
||||
else {
|
||||
xsltGenericError(xsltGenericErrorContext,
|
||||
"dyn:evaluate() : unable to evaluate expression '%s'\n",str);
|
||||
valuePush(ctxt,xmlXPathNewNodeSet(NULL));
|
||||
}
|
||||
}
|
||||
xmlFree(str);
|
||||
return;
|
||||
}
|
||||
@@ -144,9 +144,9 @@ exsltDynMapFunction(xmlXPathParserContextPtr ctxt, int nargs)
|
||||
oldContextSize = ctxt->context->contextSize;
|
||||
oldProximityPosition = ctxt->context->proximityPosition;
|
||||
|
||||
/**
|
||||
* since we really don't know we're going to be adding node(s)
|
||||
* down the road we create the RVT regardless
|
||||
/**
|
||||
* since we really don't know we're going to be adding node(s)
|
||||
* down the road we create the RVT regardless
|
||||
*/
|
||||
tctxt = xsltXPathGetTransformContext(ctxt);
|
||||
if (tctxt == NULL) {
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#include <libexslt/exsltconfig.h>
|
||||
#include "exslt.h"
|
||||
|
||||
const char *exsltLibraryVersion = LIBEXSLT_VERSION_STRING
|
||||
const char *exsltLibraryVersion = LIBEXSLT_VERSION_STRING
|
||||
LIBEXSLT_VERSION_EXTRA;
|
||||
const int exsltLibexsltVersion = LIBEXSLT_VERSION;
|
||||
const int exsltLibxsltVersion = LIBXSLT_VERSION;
|
||||
|
@@ -106,16 +106,16 @@ exsltFuncRegisterImportFunc (exsltFuncFunctionData *data,
|
||||
return;
|
||||
|
||||
if (ch->ctxt == NULL || ch->hash == NULL)
|
||||
return;
|
||||
return;
|
||||
|
||||
/* Check if already present */
|
||||
func = (exsltFuncFunctionData*)xmlHashLookup2(ch->hash, URI, name);
|
||||
if (func == NULL) { /* Not yet present - copy it in */
|
||||
func = exsltFuncNewFunctionData();
|
||||
func = exsltFuncNewFunctionData();
|
||||
memcpy(func, data, sizeof(exsltFuncFunctionData));
|
||||
if (xmlHashAddEntry2(ch->hash, URI, name, func) < 0) {
|
||||
xsltGenericError(xsltGenericErrorContext,
|
||||
"Failed to register function {%s}%s\n",
|
||||
"Failed to register function {%s}%s\n",
|
||||
URI, name);
|
||||
} else { /* Do the registration */
|
||||
xsltGenericDebug(xsltGenericDebugContext,
|
||||
@@ -146,7 +146,7 @@ exsltFuncInit (xsltTransformContextPtr ctxt, const xmlChar *URI) {
|
||||
xsltStylesheetPtr tmp;
|
||||
exsltFuncImportRegData ch;
|
||||
xmlHashTablePtr hash;
|
||||
|
||||
|
||||
ret = (exsltFuncData *) xmlMalloc (sizeof(exsltFuncData));
|
||||
if (ret == NULL) {
|
||||
xsltGenericError(xsltGenericErrorContext,
|
||||
@@ -166,7 +166,7 @@ exsltFuncInit (xsltTransformContextPtr ctxt, const xmlChar *URI) {
|
||||
while ((tmp=xsltNextImport(tmp))!=NULL) {
|
||||
hash = xsltGetExtInfo(tmp, URI);
|
||||
if (hash != NULL) {
|
||||
xmlHashScanFull(hash,
|
||||
xmlHashScanFull(hash,
|
||||
(xmlHashScannerFull) exsltFuncRegisterImportFunc, &ch);
|
||||
}
|
||||
}
|
||||
@@ -179,7 +179,7 @@ exsltFuncInit (xsltTransformContextPtr ctxt, const xmlChar *URI) {
|
||||
* @ctxt: an XSLT transformation context
|
||||
* @URI: the namespace URI for the extension
|
||||
* @data: the module data to free up
|
||||
*
|
||||
*
|
||||
* Shutdown the EXSLT - Functions module
|
||||
* Called at transformation-time.
|
||||
*/
|
||||
@@ -212,7 +212,7 @@ exsltFuncStyleInit (xsltStylesheetPtr style ATTRIBUTE_UNUSED,
|
||||
* exsltFuncStyleShutdown:
|
||||
* @style: an XSLT stylesheet
|
||||
* @URI: the namespace URI for the extension
|
||||
* @data: the stylesheet data to free up
|
||||
* @data: the stylesheet data to free up
|
||||
*
|
||||
* Shutdown the EXSLT - Function module
|
||||
* Called at compile-time.
|
||||
@@ -350,7 +350,7 @@ exsltFuncFunctionFunction (xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
* which is not very nice. There is probably a much better solution
|
||||
* (like change other code to delay the evaluation).
|
||||
*/
|
||||
/*
|
||||
/*
|
||||
* In order to give the function params and variables a new 'scope'
|
||||
* we change varsBase in the context.
|
||||
*/
|
||||
@@ -411,7 +411,7 @@ exsltFuncFunctionFunction (xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
tctxt->insert = oldInsert;
|
||||
tctxt->varsBase = oldBase; /* restore original scope */
|
||||
if (params != NULL)
|
||||
xsltFreeStackElemList(params);
|
||||
xsltFreeStackElemList(params);
|
||||
|
||||
if (data->error != 0)
|
||||
goto error;
|
||||
@@ -570,7 +570,7 @@ exsltFuncResultComp (xsltStylesheetPtr style, xmlNodePtr inst,
|
||||
* it is an error if a func:result occurs within a func:result
|
||||
* element.
|
||||
* it is an error if instanciating the content of a variable
|
||||
* binding element (i.e. xsl:variable, xsl:param) results in the
|
||||
* binding element (i.e. xsl:variable, xsl:param) results in the
|
||||
* instanciation of a func:result element.
|
||||
*/
|
||||
for (test = inst->parent; test != NULL; test = test->parent) {
|
||||
@@ -651,7 +651,7 @@ exsltFuncResultElem (xsltTransformContextPtr ctxt,
|
||||
exsltFuncResultPreComp *comp) {
|
||||
exsltFuncData *data;
|
||||
xmlXPathObjectPtr ret;
|
||||
|
||||
|
||||
|
||||
/* It is an error if instantiating the content of the
|
||||
* func:function element results in the instantiation of more than
|
||||
@@ -727,7 +727,7 @@ exsltFuncResultElem (xsltTransformContextPtr ctxt,
|
||||
data->error = 1;
|
||||
return;
|
||||
}
|
||||
xsltRegisterLocalRVT(ctxt, container);
|
||||
xsltRegisterLocalRVT(ctxt, container);
|
||||
|
||||
oldInsert = ctxt->insert;
|
||||
ctxt->insert = (xmlNodePtr) container;
|
||||
|
@@ -22,7 +22,7 @@
|
||||
#if (defined (__CYGWIN__) || defined _MSC_VER) && !defined IN_LIBEXSLT && !defined LIBEXSLT_STATIC
|
||||
#define LIBEXSLT_PUBLIC __declspec(dllimport)
|
||||
#else
|
||||
#define LIBEXSLT_PUBLIC
|
||||
#define LIBEXSLT_PUBLIC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@@ -298,7 +298,7 @@ static void
|
||||
exsltMathLowestFunction (xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
xmlNodeSetPtr ns, ret;
|
||||
void *user = NULL;
|
||||
|
||||
|
||||
|
||||
if (nargs != 1) {
|
||||
xmlXPathSetArityError(ctxt);
|
||||
@@ -368,7 +368,7 @@ exsltMathConstant (xmlChar *name, double precision) {
|
||||
|
||||
if (precision <= len)
|
||||
len = (int)precision;
|
||||
|
||||
|
||||
str = xmlStrsub(EXSLT_PI, 0, len);
|
||||
|
||||
} else if (xmlStrEqual(name, BAD_CAST "E")) {
|
||||
@@ -376,7 +376,7 @@ exsltMathConstant (xmlChar *name, double precision) {
|
||||
|
||||
if (precision <= len)
|
||||
len = (int)precision;
|
||||
|
||||
|
||||
str = xmlStrsub(EXSLT_E, 0, len);
|
||||
|
||||
} else if (xmlStrEqual(name, BAD_CAST "SQRRT2")) {
|
||||
@@ -384,7 +384,7 @@ exsltMathConstant (xmlChar *name, double precision) {
|
||||
|
||||
if (precision <= len)
|
||||
len = (int)precision;
|
||||
|
||||
|
||||
str = xmlStrsub(EXSLT_SQRRT2, 0, len);
|
||||
|
||||
} else if (xmlStrEqual(name, BAD_CAST "LN2")) {
|
||||
@@ -392,7 +392,7 @@ exsltMathConstant (xmlChar *name, double precision) {
|
||||
|
||||
if (precision <= len)
|
||||
len = (int)precision;
|
||||
|
||||
|
||||
str = xmlStrsub(EXSLT_LN2, 0, len);
|
||||
|
||||
} else if (xmlStrEqual(name, BAD_CAST "LN10")) {
|
||||
@@ -400,7 +400,7 @@ exsltMathConstant (xmlChar *name, double precision) {
|
||||
|
||||
if (precision <= len)
|
||||
len = (int)precision;
|
||||
|
||||
|
||||
str = xmlStrsub(EXSLT_LN10, 0, len);
|
||||
|
||||
} else if (xmlStrEqual(name, BAD_CAST "LOG2E")) {
|
||||
@@ -408,7 +408,7 @@ exsltMathConstant (xmlChar *name, double precision) {
|
||||
|
||||
if (precision <= len)
|
||||
len = (int)precision;
|
||||
|
||||
|
||||
str = xmlStrsub(EXSLT_LOG2E, 0, len);
|
||||
|
||||
} else if (xmlStrEqual(name, BAD_CAST "SQRT1_2")) {
|
||||
@@ -416,7 +416,7 @@ exsltMathConstant (xmlChar *name, double precision) {
|
||||
|
||||
if (precision <= len)
|
||||
len = (int)precision;
|
||||
|
||||
|
||||
str = xmlStrsub(EXSLT_SQRT1_2, 0, len);
|
||||
|
||||
} else {
|
||||
|
@@ -209,7 +209,7 @@ exsltSaxonSystemIdFunction(xmlXPathParserContextPtr ctxt, int nargs)
|
||||
* exsltSaxonLineNumberFunction:
|
||||
* @ctxt: an XPath parser context
|
||||
* @nargs: number of arguments
|
||||
*
|
||||
*
|
||||
* Implements the SAXON line-number() function
|
||||
* integer saxon:line-number()
|
||||
*
|
||||
|
@@ -27,7 +27,7 @@
|
||||
* @nargs: the number of arguments
|
||||
*
|
||||
* Splits up a string on the characters of the delimiter string and returns a
|
||||
* node set of token elements, each containing one token from the string.
|
||||
* node set of token elements, each containing one token from the string.
|
||||
*/
|
||||
static void
|
||||
exsltStrTokenizeFunction(xmlXPathParserContextPtr ctxt, int nargs)
|
||||
@@ -106,7 +106,7 @@ exsltStrTokenizeFunction(xmlXPathParserContextPtr ctxt, int nargs)
|
||||
}
|
||||
}
|
||||
if (token != cur) {
|
||||
node = xmlNewDocRawNode(container, NULL,
|
||||
node = xmlNewDocRawNode(container, NULL,
|
||||
(const xmlChar *) "token", token);
|
||||
xmlAddChild((xmlNodePtr) container, node);
|
||||
xmlXPathNodeSetAddUnique(ret->nodesetval, node);
|
||||
@@ -136,7 +136,7 @@ fail:
|
||||
* @nargs: the number of arguments
|
||||
*
|
||||
* Splits up a string on a delimiting string and returns a node set of token
|
||||
* elements, each containing one token from the string.
|
||||
* elements, each containing one token from the string.
|
||||
*/
|
||||
static void
|
||||
exsltStrSplitFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
@@ -335,7 +335,7 @@ exsltStrDecodeUriFunction (xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
xmlFree(ret);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
xmlXPathReturnString(ctxt, ret);
|
||||
|
||||
if (str != NULL)
|
||||
@@ -552,7 +552,7 @@ exsltStrReturnString(xmlXPathParserContextPtr ctxt, const xmlChar *str,
|
||||
* @ctxt: an XPath parser context
|
||||
* @nargs: the number of arguments
|
||||
*
|
||||
* Takes a string, and two node sets and returns the string with all strings in
|
||||
* Takes a string, and two node sets and returns the string with all strings in
|
||||
* the first node set replaced by all strings in the second node set.
|
||||
*/
|
||||
static void
|
||||
|
@@ -140,7 +140,7 @@ xsltFreeAttrElem(xsltAttrElemPtr attr) {
|
||||
static void
|
||||
xsltFreeAttrElemList(xsltAttrElemPtr list) {
|
||||
xsltAttrElemPtr next;
|
||||
|
||||
|
||||
while (list != NULL) {
|
||||
next = list->next;
|
||||
xsltFreeAttrElem(list);
|
||||
@@ -171,7 +171,7 @@ xsltAddAttrElemList(xsltAttrElemPtr list, xmlNodePtr attr) {
|
||||
if (list == NULL)
|
||||
return(xsltNewAttrElem(attr));
|
||||
cur = list;
|
||||
while (cur != NULL) {
|
||||
while (cur != NULL) {
|
||||
next = cur->next;
|
||||
if (cur->attr == attr)
|
||||
return(cur);
|
||||
@@ -375,7 +375,7 @@ xsltParseStylesheetAttributeSet(xsltStylesheetPtr style, xmlNodePtr cur) {
|
||||
attrItems = curAttr;
|
||||
goto next_child;
|
||||
}
|
||||
if (curAttr->next == NULL)
|
||||
if (curAttr->next == NULL)
|
||||
curAttr->next = xsltNewAttrElem(child);
|
||||
curAttr = nextAttr;
|
||||
}
|
||||
@@ -405,7 +405,7 @@ next_child:
|
||||
/*
|
||||
* Process attribue "use-attribute-sets".
|
||||
*/
|
||||
/* TODO check recursion */
|
||||
/* TODO check recursion */
|
||||
value = xmlGetNsProp(cur, (const xmlChar *)"use-attribute-sets",
|
||||
NULL);
|
||||
if (value != NULL) {
|
||||
@@ -422,7 +422,7 @@ next_child:
|
||||
const xmlChar *ncname2 = NULL;
|
||||
const xmlChar *prefix2 = NULL;
|
||||
xsltAttrElemPtr refAttrItems;
|
||||
|
||||
|
||||
#ifdef WITH_XSLT_DEBUG_ATTRIBUTES
|
||||
xsltGenericDebug(xsltGenericDebugContext,
|
||||
"xsl:attribute-set : %s adds use %s\n", ncname, curval);
|
||||
@@ -605,7 +605,7 @@ xsltResolveStylesheetAttributeSet(xsltStylesheetPtr style) {
|
||||
#endif
|
||||
style->attributeSets = xmlHashCreate(10);
|
||||
}
|
||||
xmlHashScanFull(cur->attributeSets,
|
||||
xmlHashScanFull(cur->attributeSets,
|
||||
(xmlHashScannerFull) xsltMergeSASCallback, style);
|
||||
/*
|
||||
* the attribute lists have either been migrated to style
|
||||
@@ -621,7 +621,7 @@ xsltResolveStylesheetAttributeSet(xsltStylesheetPtr style) {
|
||||
* Then resolve all the references and computes the resulting sets
|
||||
*/
|
||||
if (style->attributeSets != NULL) {
|
||||
xmlHashScanFull(style->attributeSets,
|
||||
xmlHashScanFull(style->attributeSets,
|
||||
(xmlHashScannerFull) xsltResolveSASCallback, style);
|
||||
}
|
||||
}
|
||||
@@ -645,22 +645,22 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
|
||||
{
|
||||
#ifdef XSLT_REFACTORED
|
||||
xsltStyleItemAttributePtr comp =
|
||||
(xsltStyleItemAttributePtr) castedComp;
|
||||
(xsltStyleItemAttributePtr) castedComp;
|
||||
#else
|
||||
xsltStylePreCompPtr comp = castedComp;
|
||||
#endif
|
||||
xmlNodePtr targetElem;
|
||||
xmlChar *prop = NULL;
|
||||
xmlChar *prop = NULL;
|
||||
const xmlChar *name = NULL, *prefix = NULL, *nsName = NULL;
|
||||
xmlChar *value = NULL;
|
||||
xmlNsPtr ns = NULL;
|
||||
xmlAttrPtr attr;
|
||||
xmlAttrPtr attr;
|
||||
|
||||
if ((ctxt == NULL) || (contextNode == NULL) || (inst == NULL) ||
|
||||
(inst->type != XML_ELEMENT_NODE) )
|
||||
return;
|
||||
|
||||
/*
|
||||
/*
|
||||
* A comp->has_name == 0 indicates that we need to skip this instruction,
|
||||
* since it was evaluated to be invalid already during compilation.
|
||||
*/
|
||||
@@ -690,7 +690,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
|
||||
* So report an internal error?
|
||||
*/
|
||||
if (ctxt->insert == NULL)
|
||||
return;
|
||||
return;
|
||||
/*
|
||||
* SPEC XSLT 1.0:
|
||||
* "Adding an attribute to a node that is not an element;
|
||||
@@ -702,7 +702,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
|
||||
targetElem = ctxt->insert;
|
||||
if (targetElem->type != XML_ELEMENT_NODE)
|
||||
return;
|
||||
|
||||
|
||||
/*
|
||||
* SPEC XSLT 1.0:
|
||||
* "Adding an attribute to an element after children have been added
|
||||
@@ -728,7 +728,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
|
||||
/*
|
||||
* Process the name
|
||||
* ----------------
|
||||
*/
|
||||
*/
|
||||
|
||||
#ifdef WITH_DEBUGGER
|
||||
if (ctxt->debugStatus != XSLT_DEBUG_NONE)
|
||||
@@ -774,7 +774,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
|
||||
name = xsltSplitQName(ctxt->dict, comp->name, &prefix);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Process namespace semantics
|
||||
* ---------------------------
|
||||
@@ -798,9 +798,9 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
|
||||
*/
|
||||
/* TODO: check attr acquisition wrt to the XSLT namespace */
|
||||
tmpNsName = xsltEvalAttrValueTemplate(ctxt, inst,
|
||||
(const xmlChar *) "namespace", XSLT_NAMESPACE);
|
||||
(const xmlChar *) "namespace", XSLT_NAMESPACE);
|
||||
/*
|
||||
* This fixes bug #302020: The AVT might also evaluate to the
|
||||
* This fixes bug #302020: The AVT might also evaluate to the
|
||||
* empty string; this means that the empty string also indicates
|
||||
* "no namespace".
|
||||
* SPEC XSLT 1.0:
|
||||
@@ -809,7 +809,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
|
||||
*/
|
||||
if ((tmpNsName != NULL) && (tmpNsName[0] != 0))
|
||||
nsName = xmlDictLookup(ctxt->dict, BAD_CAST tmpNsName, -1);
|
||||
xmlFree(tmpNsName);
|
||||
xmlFree(tmpNsName);
|
||||
}
|
||||
|
||||
if (xmlStrEqual(nsName, BAD_CAST "http://www.w3.org/2000/xmlns/")) {
|
||||
@@ -830,7 +830,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
|
||||
* expanded into an expanded-name using the namespace declarations
|
||||
* in effect for the xsl:attribute element, *not* including any
|
||||
* default namespace declaration."
|
||||
*/
|
||||
*/
|
||||
ns = xmlSearchNs(inst->doc, inst, prefix);
|
||||
if (ns == NULL) {
|
||||
/*
|
||||
@@ -843,7 +843,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
|
||||
"this is an error, since the namespace was not "
|
||||
"specified by the instruction itself.\n", prefix, name);
|
||||
} else
|
||||
nsName = ns->href;
|
||||
nsName = ns->href;
|
||||
}
|
||||
|
||||
if (fromAttributeSet) {
|
||||
@@ -863,9 +863,9 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
|
||||
* Find/create a matching ns-decl in the result tree.
|
||||
*/
|
||||
ns = NULL;
|
||||
|
||||
|
||||
#if 0
|
||||
if (0) {
|
||||
if (0) {
|
||||
/*
|
||||
* OPTIMIZE TODO: How do we know if we are adding to a
|
||||
* fragment or to the result tree?
|
||||
@@ -884,7 +884,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
|
||||
}
|
||||
#endif
|
||||
|
||||
if (nsName != NULL) {
|
||||
if (nsName != NULL) {
|
||||
/*
|
||||
* Something about ns-prefixes:
|
||||
* SPEC XSLT 1.0:
|
||||
@@ -925,12 +925,12 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
|
||||
* TODO: Do we need to put the empty string in ?
|
||||
*/
|
||||
attr = xmlSetNsProp(ctxt->insert, ns, name, (const xmlChar *) "");
|
||||
} else if ((inst->children->next == NULL) &&
|
||||
} else if ((inst->children->next == NULL) &&
|
||||
((inst->children->type == XML_TEXT_NODE) ||
|
||||
(inst->children->type == XML_CDATA_SECTION_NODE)))
|
||||
{
|
||||
xmlNodePtr copyTxt;
|
||||
|
||||
|
||||
/*
|
||||
* xmlSetNsProp() will take care of duplicates.
|
||||
*/
|
||||
@@ -965,7 +965,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
|
||||
*/
|
||||
copyTxt = xmlNewText(inst->children->content);
|
||||
if (copyTxt == NULL) /* TODO: report error */
|
||||
goto error;
|
||||
goto error;
|
||||
}
|
||||
attr->children = attr->last = copyTxt;
|
||||
copyTxt->parent = (xmlNodePtr) attr;
|
||||
@@ -976,7 +976,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
|
||||
* anyway?
|
||||
*/
|
||||
if (inst->children->name == xmlStringTextNoenc)
|
||||
copyTxt->name = xmlStringTextNoenc;
|
||||
copyTxt->name = xmlStringTextNoenc;
|
||||
|
||||
/*
|
||||
* since we create the attribute without content IDness must be
|
||||
@@ -1005,7 +1005,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
|
||||
}
|
||||
|
||||
error:
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1041,10 +1041,10 @@ xsltApplyAttributeSet(xsltTransformContextPtr ctxt, xmlNodePtr node,
|
||||
const xmlChar *attrSets)
|
||||
{
|
||||
const xmlChar *ncname = NULL;
|
||||
const xmlChar *prefix = NULL;
|
||||
const xmlChar *prefix = NULL;
|
||||
const xmlChar *curstr, *endstr;
|
||||
xsltAttrElemPtr attrs;
|
||||
xsltStylesheetPtr style;
|
||||
xsltStylesheetPtr style;
|
||||
|
||||
if (attrSets == NULL) {
|
||||
if (inst == NULL)
|
||||
@@ -1056,7 +1056,7 @@ xsltApplyAttributeSet(xsltTransformContextPtr ctxt, xmlNodePtr node,
|
||||
if (inst->type == XML_ATTRIBUTE_NODE) {
|
||||
if ( ((xmlAttrPtr) inst)->children != NULL)
|
||||
attrSets = ((xmlAttrPtr) inst)->children->content;
|
||||
|
||||
|
||||
}
|
||||
if (attrSets == NULL) {
|
||||
/*
|
||||
|
@@ -21,14 +21,14 @@ extern "C" {
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltParseStylesheetAttributeSet (xsltStylesheetPtr style,
|
||||
xmlNodePtr cur);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeAttributeSetsHashes (xsltStylesheetPtr style);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltApplyAttributeSet (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr inst,
|
||||
const xmlChar *attributes);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltResolveStylesheetAttributeSet(xsltStylesheetPtr style);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -147,7 +147,7 @@ static xsltAttrVTPtr
|
||||
xsltSetAttrVTsegment(xsltAttrVTPtr avt, void *val) {
|
||||
if (avt->nb_seg >= avt->max_seg) {
|
||||
avt = (xsltAttrVTPtr) xmlRealloc(avt, sizeof(xsltAttrVT) +
|
||||
avt->max_seg * sizeof(void *));
|
||||
avt->max_seg * sizeof(void *));
|
||||
if (avt == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -178,7 +178,7 @@ xsltCompileAttr(xsltStylesheetPtr style, xmlAttrPtr attr) {
|
||||
|
||||
if ((style == NULL) || (attr == NULL) || (attr->children == NULL))
|
||||
return;
|
||||
if ((attr->children->type != XML_TEXT_NODE) ||
|
||||
if ((attr->children->type != XML_TEXT_NODE) ||
|
||||
(attr->children->next != NULL)) {
|
||||
xsltTransformError(NULL, style, attr->parent,
|
||||
"Attribute '%s': The content is expected to be a single text "
|
||||
@@ -248,7 +248,7 @@ xsltCompileAttr(xsltStylesheetPtr style, xmlAttrPtr attr) {
|
||||
/* Need to check for literal (bug539741) */
|
||||
if ((*cur == '\'') || (*cur == '"')) {
|
||||
char delim = *(cur++);
|
||||
while ((*cur != 0) && (*cur != delim))
|
||||
while ((*cur != 0) && (*cur != delim))
|
||||
cur++;
|
||||
if (*cur != 0)
|
||||
cur++; /* skip the ending delimiter */
|
||||
|
@@ -36,9 +36,9 @@
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Hooks for the document loader *
|
||||
* *
|
||||
* *
|
||||
* Hooks for the document loader *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -116,7 +116,7 @@ xsltDocLoaderFunc xsltDocDefaultLoader = xsltDocDefaultLoaderFunc;
|
||||
* Set the new function to load document, if NULL it resets it to the
|
||||
* default function.
|
||||
*/
|
||||
|
||||
|
||||
void
|
||||
xsltSetLoaderFunc(xsltDocLoaderFunc f) {
|
||||
if (f == NULL)
|
||||
@@ -140,7 +140,7 @@ xsltSetLoaderFunc(xsltDocLoaderFunc f) {
|
||||
*
|
||||
* Returns a handler to the document
|
||||
*/
|
||||
xsltDocumentPtr
|
||||
xsltDocumentPtr
|
||||
xsltNewDocument(xsltTransformContextPtr ctxt, xmlDocPtr doc) {
|
||||
xsltDocumentPtr cur;
|
||||
|
||||
@@ -179,7 +179,7 @@ xsltNewDocument(xsltTransformContextPtr ctxt, xmlDocPtr doc) {
|
||||
*
|
||||
* Returns a handler to the document
|
||||
*/
|
||||
xsltDocumentPtr
|
||||
xsltDocumentPtr
|
||||
xsltNewStyleDocument(xsltStylesheetPtr style, xmlDocPtr doc) {
|
||||
xsltDocumentPtr cur;
|
||||
|
||||
@@ -204,15 +204,15 @@ xsltNewStyleDocument(xsltStylesheetPtr style, xmlDocPtr doc) {
|
||||
*
|
||||
* Frees the node-trees (and xsltDocument structures) of all
|
||||
* stylesheet-modules of the stylesheet-level represented by
|
||||
* the given @style.
|
||||
* the given @style.
|
||||
*/
|
||||
void
|
||||
void
|
||||
xsltFreeStyleDocuments(xsltStylesheetPtr style) {
|
||||
xsltDocumentPtr doc, cur;
|
||||
#ifdef XSLT_REFACTORED_XSLT_NSCOMP
|
||||
xsltNsMapPtr nsMap;
|
||||
#endif
|
||||
|
||||
|
||||
if (style == NULL)
|
||||
return;
|
||||
|
||||
@@ -220,8 +220,8 @@ xsltFreeStyleDocuments(xsltStylesheetPtr style) {
|
||||
if (XSLT_HAS_INTERNAL_NSMAP(style))
|
||||
nsMap = XSLT_GET_INTERNAL_NSMAP(style);
|
||||
else
|
||||
nsMap = NULL;
|
||||
#endif
|
||||
nsMap = NULL;
|
||||
#endif
|
||||
|
||||
cur = style->docList;
|
||||
while (cur != NULL) {
|
||||
@@ -247,7 +247,7 @@ xsltFreeStyleDocuments(xsltStylesheetPtr style) {
|
||||
*
|
||||
* Free up all the space used by the loaded documents
|
||||
*/
|
||||
void
|
||||
void
|
||||
xsltFreeDocuments(xsltTransformContextPtr ctxt) {
|
||||
xsltDocumentPtr doc, cur;
|
||||
|
||||
@@ -281,7 +281,7 @@ xsltFreeDocuments(xsltTransformContextPtr ctxt) {
|
||||
*
|
||||
* Returns the new xsltDocumentPtr or NULL in case of error
|
||||
*/
|
||||
xsltDocumentPtr
|
||||
xsltDocumentPtr
|
||||
xsltLoadDocument(xsltTransformContextPtr ctxt, const xmlChar *URI) {
|
||||
xsltDocumentPtr ret;
|
||||
xmlDocPtr doc;
|
||||
@@ -294,7 +294,7 @@ xsltLoadDocument(xsltTransformContextPtr ctxt, const xmlChar *URI) {
|
||||
*/
|
||||
if (ctxt->sec != NULL) {
|
||||
int res;
|
||||
|
||||
|
||||
res = xsltCheckRead(ctxt->sec, ctxt, URI);
|
||||
if (res == 0) {
|
||||
xsltTransformError(ctxt, NULL, NULL,
|
||||
@@ -355,7 +355,7 @@ xsltLoadDocument(xsltTransformContextPtr ctxt, const xmlChar *URI) {
|
||||
*
|
||||
* Returns the new xsltDocumentPtr or NULL in case of error
|
||||
*/
|
||||
xsltDocumentPtr
|
||||
xsltDocumentPtr
|
||||
xsltLoadStyleDocument(xsltStylesheetPtr style, const xmlChar *URI) {
|
||||
xsltDocumentPtr ret;
|
||||
xmlDocPtr doc;
|
||||
|
@@ -20,26 +20,26 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
XSLTPUBFUN xsltDocumentPtr XSLTCALL
|
||||
XSLTPUBFUN xsltDocumentPtr XSLTCALL
|
||||
xsltNewDocument (xsltTransformContextPtr ctxt,
|
||||
xmlDocPtr doc);
|
||||
XSLTPUBFUN xsltDocumentPtr XSLTCALL
|
||||
xsltLoadDocument (xsltTransformContextPtr ctxt,
|
||||
XSLTPUBFUN xsltDocumentPtr XSLTCALL
|
||||
xsltLoadDocument (xsltTransformContextPtr ctxt,
|
||||
const xmlChar *URI);
|
||||
XSLTPUBFUN xsltDocumentPtr XSLTCALL
|
||||
xsltFindDocument (xsltTransformContextPtr ctxt,
|
||||
XSLTPUBFUN xsltDocumentPtr XSLTCALL
|
||||
xsltFindDocument (xsltTransformContextPtr ctxt,
|
||||
xmlDocPtr doc);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeDocuments (xsltTransformContextPtr ctxt);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeDocuments (xsltTransformContextPtr ctxt);
|
||||
|
||||
XSLTPUBFUN xsltDocumentPtr XSLTCALL
|
||||
xsltLoadStyleDocument (xsltStylesheetPtr style,
|
||||
XSLTPUBFUN xsltDocumentPtr XSLTCALL
|
||||
xsltLoadStyleDocument (xsltStylesheetPtr style,
|
||||
const xmlChar *URI);
|
||||
XSLTPUBFUN xsltDocumentPtr XSLTCALL
|
||||
xsltNewStyleDocument (xsltStylesheetPtr style,
|
||||
XSLTPUBFUN xsltDocumentPtr XSLTCALL
|
||||
xsltNewStyleDocument (xsltStylesheetPtr style,
|
||||
xmlDocPtr doc);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeStyleDocuments (xsltStylesheetPtr style);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeStyleDocuments (xsltStylesheetPtr style);
|
||||
|
||||
/*
|
||||
* Hooks for document loading
|
||||
|
@@ -44,9 +44,9 @@
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Private Types and Globals *
|
||||
* *
|
||||
* *
|
||||
* Private Types and Globals *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
typedef struct _xsltExtDef xsltExtDef;
|
||||
@@ -89,9 +89,9 @@ static xmlHashTablePtr xsltModuleHash = NULL;
|
||||
static xmlMutexPtr xsltExtMutex = NULL;
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Type functions *
|
||||
* *
|
||||
* *
|
||||
* Type functions *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -302,18 +302,18 @@ typedef void (*exsltRegisterFunction) (void);
|
||||
* @URI: the function or element namespace URI
|
||||
*
|
||||
* Dynamically loads an extension plugin when available.
|
||||
*
|
||||
* The plugin name is derived from the URI by removing the
|
||||
*
|
||||
* The plugin name is derived from the URI by removing the
|
||||
* initial protocol designation, e.g. "http://", then converting
|
||||
* the characters ".", "-", "/", and "\" into "_", the removing
|
||||
* any trailing "/", then concatenating LIBXML_MODULE_EXTENSION.
|
||||
*
|
||||
* Plugins are loaded from the directory specified by the
|
||||
* environment variable LIBXSLT_PLUGINS_PATH, or if NULL,
|
||||
*
|
||||
* Plugins are loaded from the directory specified by the
|
||||
* environment variable LIBXSLT_PLUGINS_PATH, or if NULL,
|
||||
* by LIBXSLT_DEFAULT_PLUGINS_PATH() which is determined at
|
||||
* compile time.
|
||||
*
|
||||
* Returns 0 if successful, -1 in case of error.
|
||||
* Returns 0 if successful, -1 in case of error.
|
||||
*/
|
||||
|
||||
static int
|
||||
@@ -391,7 +391,7 @@ xsltExtModuleRegisterDynamic(const xmlChar * URI)
|
||||
|
||||
#ifdef WITH_XSLT_DEBUG_EXTENSIONS
|
||||
xsltGenericDebug(xsltGenericDebugContext,
|
||||
"Attempting to load plugin: %s for URI: %s\n",
|
||||
"Attempting to load plugin: %s for URI: %s\n",
|
||||
module_filename, URI);
|
||||
#endif
|
||||
|
||||
@@ -442,7 +442,7 @@ xsltExtModuleRegisterDynamic(const xmlChar * URI)
|
||||
|
||||
#ifdef WITH_XSLT_DEBUG_EXTENSIONS
|
||||
xsltGenericDebug(xsltGenericDebugContext,
|
||||
"xmlModuleSymbol failed for plugin: %s, regfunc: %s\n",
|
||||
"xmlModuleSymbol failed for plugin: %s, regfunc: %s\n",
|
||||
module_filename, regfunc_name);
|
||||
#endif
|
||||
|
||||
@@ -463,9 +463,9 @@ xsltExtModuleRegisterDynamic(const xmlChar * URI ATTRIBUTE_UNUSED)
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* The stylesheet extension prefixes handling *
|
||||
* *
|
||||
* *
|
||||
* The stylesheet extension prefixes handling *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
|
||||
@@ -487,7 +487,7 @@ xsltFreeExts(xsltStylesheetPtr style)
|
||||
* @style: an XSLT stylesheet
|
||||
* @prefix: the prefix used (optional)
|
||||
* @URI: the URI associated to the extension
|
||||
*
|
||||
*
|
||||
* Registers an extension namespace
|
||||
* This is called from xslt.c during compile-time.
|
||||
* The given prefix is not needed.
|
||||
@@ -567,9 +567,9 @@ xsltRegisterExtPrefix(xsltStylesheetPtr style,
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* The extensions modules interfaces *
|
||||
* *
|
||||
* *
|
||||
* The extensions modules interfaces *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -577,7 +577,7 @@ xsltRegisterExtPrefix(xsltStylesheetPtr style,
|
||||
* @ctxt: an XSLT transformation context
|
||||
* @name: the name of the element
|
||||
* @URI: the URI associated to the element
|
||||
* @function: the actual implementation which should be called
|
||||
* @function: the actual implementation which should be called
|
||||
*
|
||||
* Registers an extension function
|
||||
*
|
||||
@@ -611,7 +611,7 @@ xsltRegisterExtFunction(xsltTransformContextPtr ctxt, const xmlChar * name,
|
||||
* @ctxt: an XSLT transformation context
|
||||
* @name: the name of the element
|
||||
* @URI: the URI associated to the element
|
||||
* @function: the actual implementation which should be called
|
||||
* @function: the actual implementation which should be called
|
||||
*
|
||||
* Registers an extension element
|
||||
*
|
||||
@@ -666,8 +666,8 @@ xsltStyleInitializeStylesheetModule(xsltStylesheetPtr style,
|
||||
xsltExtDataPtr dataContainer;
|
||||
void *userData = NULL;
|
||||
xsltExtModulePtr module;
|
||||
|
||||
if ((style == NULL) || (URI == NULL))
|
||||
|
||||
if ((style == NULL) || (URI == NULL))
|
||||
return(NULL);
|
||||
|
||||
if (xsltExtensionsHash == NULL) {
|
||||
@@ -716,7 +716,7 @@ xsltStyleInitializeStylesheetModule(xsltStylesheetPtr style,
|
||||
* Fire the initialization callback.
|
||||
*/
|
||||
userData = module->styleInitFunc(style, URI);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Store the user-data in the context of the given stylesheet.
|
||||
*/
|
||||
@@ -727,7 +727,7 @@ xsltStyleInitializeStylesheetModule(xsltStylesheetPtr style,
|
||||
if (xmlHashAddEntry(style->extInfos, URI,
|
||||
(void *) dataContainer) < 0)
|
||||
{
|
||||
xsltTransformError(NULL, style, NULL,
|
||||
xsltTransformError(NULL, style, NULL,
|
||||
"Failed to register module '%s'.\n", URI);
|
||||
style->errors++;
|
||||
if (module->styleShutdownFunc)
|
||||
@@ -762,7 +762,7 @@ xsltStyleGetExtData(xsltStylesheetPtr style, const xmlChar * URI)
|
||||
(xsltExtensionsHash == NULL))
|
||||
return (NULL);
|
||||
|
||||
|
||||
|
||||
#ifdef XSLT_REFACTORED
|
||||
/*
|
||||
* This is intended for global storage, so only the main
|
||||
@@ -838,7 +838,7 @@ xsltStyleStylesheetLevelGetExtData(xsltStylesheetPtr style,
|
||||
*/
|
||||
if (dataContainer)
|
||||
return(dataContainer->extData);
|
||||
}
|
||||
}
|
||||
|
||||
dataContainer =
|
||||
xsltStyleInitializeStylesheetModule(style, URI);
|
||||
@@ -1120,7 +1120,7 @@ xsltShutdownExt(xsltExtDataPtr data, xsltStylesheetPtr style,
|
||||
*
|
||||
* xmlHashRemoveEntry(style->extInfos, URI,
|
||||
* (xmlHashDeallocator) xsltFreeExtData);
|
||||
*/
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1156,12 +1156,12 @@ xsltShutdownExts(xsltStylesheetPtr style)
|
||||
*/
|
||||
int
|
||||
xsltCheckExtPrefix(xsltStylesheetPtr style, const xmlChar * URI)
|
||||
{
|
||||
{
|
||||
#ifdef XSLT_REFACTORED
|
||||
if ((style == NULL) || (style->compCtxt == NULL) ||
|
||||
(XSLT_CCTXT(style)->inode == NULL) ||
|
||||
(XSLT_CCTXT(style)->inode->extElemNs == NULL))
|
||||
return (0);
|
||||
return (0);
|
||||
/*
|
||||
* Lookup the extension namespaces registered
|
||||
* at the current node in the stylesheet's tree.
|
||||
@@ -1175,7 +1175,7 @@ xsltCheckExtPrefix(xsltStylesheetPtr style, const xmlChar * URI)
|
||||
URI))
|
||||
{
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -1950,15 +1950,15 @@ xsltGetExtInfo(xsltStylesheetPtr style, const xmlChar * URI)
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Test module http://xmlsoft.org/XSLT/ *
|
||||
* *
|
||||
* *
|
||||
* Test module http://xmlsoft.org/XSLT/ *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Test of the extension module API *
|
||||
* *
|
||||
* *
|
||||
* Test of the extension module API *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
static xmlChar *testData = NULL;
|
||||
|
@@ -40,9 +40,9 @@
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Handling of XSLT debugging *
|
||||
* *
|
||||
* *
|
||||
* Handling of XSLT debugging *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -112,9 +112,9 @@ xsltDebug(xsltTransformContextPtr ctxt, xmlNodePtr node ATTRIBUTE_UNUSED,
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Classic extensions as described by M. Kay *
|
||||
* *
|
||||
* *
|
||||
* Classic extensions as described by M. Kay *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -178,14 +178,14 @@ xsltFunctionLocalTime(xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
time_t gmt, lmt;
|
||||
struct tm gmt_tm;
|
||||
struct tm *local_tm;
|
||||
|
||||
|
||||
if (nargs != 1) {
|
||||
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
|
||||
"localTime() : invalid number of args %d\n", nargs);
|
||||
ctxt->error = XPATH_INVALID_ARITY;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
obj = valuePop(ctxt);
|
||||
|
||||
if (obj->type != XPATH_STRING) {
|
||||
@@ -195,7 +195,7 @@ xsltFunctionLocalTime(xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
valuePush(ctxt, xmlXPathNewString((const xmlChar *)""));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
str = (char *) obj->stringval;
|
||||
|
||||
/* str = "$Date$" */
|
||||
|
@@ -60,16 +60,16 @@ extern "C" {
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFunctionNodeSet (xmlXPathParserContextPtr ctxt,
|
||||
int nargs);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltDebug (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr inst,
|
||||
xsltStylePreCompPtr comp);
|
||||
|
||||
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltRegisterExtras (xsltTransformContextPtr ctxt);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltRegisterAllExtras (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -118,16 +118,16 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
|
||||
"document() : internal error tctxt == NULL\n");
|
||||
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
uri = xmlParseURI((const char *) URI);
|
||||
if (uri == NULL) {
|
||||
xsltTransformError(tctxt, NULL, NULL,
|
||||
"document() : failed to parse URI\n");
|
||||
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* check for and remove fragment identifier
|
||||
*/
|
||||
@@ -141,12 +141,12 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
|
||||
} else
|
||||
idoc = xsltLoadDocument(tctxt, URI);
|
||||
xmlFreeURI(uri);
|
||||
|
||||
|
||||
if (idoc == NULL) {
|
||||
if ((URI == NULL) ||
|
||||
(URI[0] == '#') ||
|
||||
((tctxt->style->doc != NULL) &&
|
||||
(xmlStrEqual(tctxt->style->doc->URL, URI))))
|
||||
(xmlStrEqual(tctxt->style->doc->URL, URI))))
|
||||
{
|
||||
/*
|
||||
* This selects the stylesheet's doc itself.
|
||||
@@ -167,7 +167,7 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
|
||||
valuePush(ctxt, xmlXPathNewNodeSet((xmlNodePtr) doc));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* use XPointer of HTML location for fragment ID */
|
||||
#ifdef LIBXML_XPTR_ENABLED
|
||||
xptrctxt = xmlXPtrNewContext(doc, NULL, NULL);
|
||||
@@ -180,11 +180,11 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
|
||||
resObj = xmlXPtrEval(fragment, xptrctxt);
|
||||
xmlXPathFreeContext(xptrctxt);
|
||||
#endif
|
||||
xmlFree(fragment);
|
||||
xmlFree(fragment);
|
||||
|
||||
if (resObj == NULL)
|
||||
goto out_fragment;
|
||||
|
||||
|
||||
switch (resObj->type) {
|
||||
case XPATH_NODESET:
|
||||
break;
|
||||
@@ -198,11 +198,11 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
|
||||
case XPATH_RANGE:
|
||||
case XPATH_LOCATIONSET:
|
||||
xsltTransformError(tctxt, NULL, NULL,
|
||||
"document() : XPointer does not select a node set: #%s\n",
|
||||
"document() : XPointer does not select a node set: #%s\n",
|
||||
fragment);
|
||||
goto out_object;
|
||||
}
|
||||
|
||||
|
||||
valuePush(ctxt, resObj);
|
||||
return;
|
||||
|
||||
@@ -355,15 +355,15 @@ xsltDocumentFunction(xmlXPathParserContextPtr ctxt, int nargs)
|
||||
* node-set key(string, object)
|
||||
*/
|
||||
void
|
||||
xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
|
||||
xmlXPathObjectPtr obj1, obj2;
|
||||
|
||||
xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
|
||||
xmlXPathObjectPtr obj1, obj2;
|
||||
|
||||
if (nargs != 2) {
|
||||
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
|
||||
"key() : expects two arguments\n");
|
||||
ctxt->error = XPATH_INVALID_ARITY;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the key's value.
|
||||
@@ -382,7 +382,7 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
|
||||
/*
|
||||
* Get the key's name.
|
||||
*/
|
||||
obj1 = valuePop(ctxt);
|
||||
obj1 = valuePop(ctxt);
|
||||
|
||||
if ((obj2->type == XPATH_NODESET) || (obj2->type == XPATH_XSLT_TREE)) {
|
||||
int i;
|
||||
@@ -408,7 +408,7 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
|
||||
xmlNodeSetPtr nodelist = NULL;
|
||||
xmlChar *key = NULL, *value;
|
||||
const xmlChar *keyURI;
|
||||
xsltTransformContextPtr tctxt;
|
||||
xsltTransformContextPtr tctxt;
|
||||
xmlChar *qname, *prefix;
|
||||
xmlXPathContextPtr xpctxt = ctxt->context;
|
||||
xmlNodePtr tmpNode = NULL;
|
||||
@@ -424,7 +424,7 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
|
||||
"The context node is not set on the XPath context.\n");
|
||||
tctxt->state = XSLT_STATE_STOPPED;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Get the associated namespace URI if qualified name
|
||||
*/
|
||||
@@ -464,7 +464,7 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
|
||||
}
|
||||
obj2 = valuePop(ctxt);
|
||||
value = obj2->stringval;
|
||||
|
||||
|
||||
/*
|
||||
* We need to ensure that ctxt->document is available for
|
||||
* xsltGetKey().
|
||||
@@ -474,7 +474,7 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
|
||||
* or the doc might be a Result Tree Fragment.
|
||||
* FUTURE INFO: In XSLT 2.0 the key() function takes an additional
|
||||
* argument indicating the doc to use.
|
||||
*/
|
||||
*/
|
||||
if (xpctxt->node->type == XML_NAMESPACE_DECL) {
|
||||
/*
|
||||
* REVISIT: This is a libxml hack! Check xpath.c for details.
|
||||
@@ -498,7 +498,7 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
|
||||
|
||||
if ((tctxt->document == NULL) ||
|
||||
(tctxt->document->doc != tmpNode->doc))
|
||||
{
|
||||
{
|
||||
if (tmpNode->doc->name && (tmpNode->doc->name[0] == ' ')) {
|
||||
/*
|
||||
* This is a Result Tree Fragment.
|
||||
@@ -508,7 +508,7 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
|
||||
if (tmpNode->doc->_private == NULL)
|
||||
goto error;
|
||||
}
|
||||
tctxt->document = (xsltDocumentPtr) tmpNode->doc->_private;
|
||||
tctxt->document = (xsltDocumentPtr) tmpNode->doc->_private;
|
||||
} else {
|
||||
/*
|
||||
* May be the initial source doc or a doc acquired via the
|
||||
@@ -529,18 +529,18 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
|
||||
*/
|
||||
nodelist = xsltGetKey(tctxt, key, keyURI, value);
|
||||
|
||||
error:
|
||||
error:
|
||||
tctxt->document = oldDocInfo;
|
||||
valuePush(ctxt, xmlXPathWrapNodeSet(
|
||||
xmlXPathNodeSetMerge(NULL, nodelist)));
|
||||
if (key != NULL)
|
||||
xmlFree(key);
|
||||
}
|
||||
}
|
||||
|
||||
if (obj1 != NULL)
|
||||
xmlXPathFreeObject(obj1);
|
||||
if (obj2 != NULL)
|
||||
xmlXPathFreeObject(obj2);
|
||||
xmlXPathFreeObject(obj2);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -612,7 +612,7 @@ xsltFormatNumberFunction(xmlXPathParserContextPtr ctxt, int nargs)
|
||||
if (sheet == NULL)
|
||||
return;
|
||||
formatValues = sheet->decimalFormat;
|
||||
|
||||
|
||||
switch (nargs) {
|
||||
case 3:
|
||||
CAST_TO_STRING;
|
||||
@@ -620,7 +620,7 @@ xsltFormatNumberFunction(xmlXPathParserContextPtr ctxt, int nargs)
|
||||
formatValues = xsltDecimalFormatGetByName(sheet, decimalObj->stringval);
|
||||
if (formatValues == NULL) {
|
||||
xsltTransformError(tctxt, NULL, NULL,
|
||||
"format-number() : undeclared decimal format '%s'\n",
|
||||
"format-number() : undeclared decimal format '%s'\n",
|
||||
decimalObj->stringval);
|
||||
}
|
||||
/* Intentional fall-through */
|
||||
@@ -967,9 +967,9 @@ xsltCurrentFunction(xmlXPathParserContextPtr ctxt, int nargs){
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Registration of XSLT and libxslt functions *
|
||||
* *
|
||||
* *
|
||||
* Registration of XSLT and libxslt functions *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
|
@@ -38,28 +38,28 @@ XSLTPUBFUN xmlXPathFunction XSLTCALL
|
||||
* Interfaces for the functions implementations.
|
||||
*/
|
||||
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltDocumentFunction (xmlXPathParserContextPtr ctxt,
|
||||
int nargs);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltKeyFunction (xmlXPathParserContextPtr ctxt,
|
||||
int nargs);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltUnparsedEntityURIFunction (xmlXPathParserContextPtr ctxt,
|
||||
int nargs);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFormatNumberFunction (xmlXPathParserContextPtr ctxt,
|
||||
int nargs);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltGenerateIdFunction (xmlXPathParserContextPtr ctxt,
|
||||
int nargs);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSystemPropertyFunction (xmlXPathParserContextPtr ctxt,
|
||||
int nargs);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltElementAvailableFunction (xmlXPathParserContextPtr ctxt,
|
||||
int nargs);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFunctionAvailableFunction (xmlXPathParserContextPtr ctxt,
|
||||
int nargs);
|
||||
|
||||
@@ -67,7 +67,7 @@ XSLTPUBFUN void XSLTCALL
|
||||
* And the registration
|
||||
*/
|
||||
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltRegisterAllFunctions (xmlXPathContextPtr ctxt);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -59,10 +59,10 @@
|
||||
* @style: the stylesheet being imported by the master
|
||||
*
|
||||
* normalize the comp steps for the stylesheet being imported
|
||||
* by the master, together with any imports within that.
|
||||
* by the master, together with any imports within that.
|
||||
*
|
||||
*/
|
||||
static void xsltFixImportedCompSteps(xsltStylesheetPtr master,
|
||||
static void xsltFixImportedCompSteps(xsltStylesheetPtr master,
|
||||
xsltStylesheetPtr style) {
|
||||
xsltStylesheetPtr res;
|
||||
xmlHashScan(style->templatesHash,
|
||||
@@ -230,7 +230,7 @@ xsltParseStylesheetInclude(xsltStylesheetPtr style, xmlNodePtr cur) {
|
||||
"xsl:include : unable to load %s\n", URI);
|
||||
goto error;
|
||||
}
|
||||
#ifdef XSLT_REFACTORED
|
||||
#ifdef XSLT_REFACTORED
|
||||
if (IS_XSLT_ELEM_FAST(cur) && (cur->psvi != NULL)) {
|
||||
((xsltStyleItemIncludePtr) cur->psvi)->include = include;
|
||||
} else {
|
||||
|
@@ -48,21 +48,21 @@ extern "C" {
|
||||
/*
|
||||
* Module interfaces
|
||||
*/
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltParseStylesheetImport(xsltStylesheetPtr style,
|
||||
xmlNodePtr cur);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltParseStylesheetInclude
|
||||
(xsltStylesheetPtr style,
|
||||
xmlNodePtr cur);
|
||||
XSLTPUBFUN xsltStylesheetPtr XSLTCALL
|
||||
XSLTPUBFUN xsltStylesheetPtr XSLTCALL
|
||||
xsltNextImport (xsltStylesheetPtr style);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltNeedElemSpaceHandling(xsltTransformContextPtr ctxt);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltFindElemSpaceHandling(xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr node);
|
||||
XSLTPUBFUN xsltTemplatePtr XSLTCALL
|
||||
XSLTPUBFUN xsltTemplatePtr XSLTCALL
|
||||
xsltFindTemplate (xsltTransformContextPtr ctxt,
|
||||
const xmlChar *name,
|
||||
const xmlChar *nameURI);
|
||||
|
@@ -38,9 +38,9 @@ xsltInitDocKeyTable(xsltTransformContextPtr ctxt, const xmlChar *name,
|
||||
const xmlChar *nameURI);
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Type functions *
|
||||
* *
|
||||
* *
|
||||
* Type functions *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -159,7 +159,7 @@ xsltFreeKeyTable(xsltKeyTablePtr keyt) {
|
||||
if (keyt->nameURI != NULL)
|
||||
xmlFree(keyt->nameURI);
|
||||
if (keyt->keys != NULL)
|
||||
xmlHashFree(keyt->keys,
|
||||
xmlHashFree(keyt->keys,
|
||||
(xmlHashDeallocator) xmlXPathFreeNodeSet);
|
||||
memset(keyt, -1, sizeof(xsltKeyTable));
|
||||
xmlFree(keyt);
|
||||
@@ -183,9 +183,9 @@ xsltFreeKeyTableList(xsltKeyTablePtr keyt) {
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* The interpreter for the precompiled patterns *
|
||||
* *
|
||||
* *
|
||||
* The interpreter for the precompiled patterns *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
|
||||
|
@@ -32,17 +32,17 @@ XSLTPUBFUN int XSLTCALL
|
||||
const xmlChar *match,
|
||||
const xmlChar *use,
|
||||
xmlNodePtr inst);
|
||||
XSLTPUBFUN xmlNodeSetPtr XSLTCALL
|
||||
XSLTPUBFUN xmlNodeSetPtr XSLTCALL
|
||||
xsltGetKey (xsltTransformContextPtr ctxt,
|
||||
const xmlChar *name,
|
||||
const xmlChar *nameURI,
|
||||
const xmlChar *value);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltInitCtxtKeys (xsltTransformContextPtr ctxt,
|
||||
xsltDocumentPtr doc);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeKeys (xsltStylesheetPtr style);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeDocumentKeys (xsltDocumentPtr doc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#if (defined (__CYGWIN__) || defined _MSC_VER) && !defined IN_LIBXSLT && !defined LIBXSLT_STATIC
|
||||
#define LIBXSLT_PUBLIC __declspec(dllimport)
|
||||
#else
|
||||
#define LIBXSLT_PUBLIC
|
||||
#define LIBXSLT_PUBLIC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@@ -55,7 +55,7 @@
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
#ifdef XSLT_REFACTORED
|
||||
#ifdef XSLT_REFACTORED
|
||||
static xsltNsAliasPtr
|
||||
xsltNewNsAlias(xsltCompilerCtxtPtr cctxt)
|
||||
{
|
||||
@@ -71,12 +71,12 @@ xsltNewNsAlias(xsltCompilerCtxtPtr cctxt)
|
||||
cctxt->style->errors++;
|
||||
return(NULL);
|
||||
}
|
||||
memset(ret, 0, sizeof(xsltNsAlias));
|
||||
memset(ret, 0, sizeof(xsltNsAlias));
|
||||
/*
|
||||
* TODO: Store the item at current stylesheet-level.
|
||||
*/
|
||||
ret->next = cctxt->nsAliases;
|
||||
cctxt->nsAliases = ret;
|
||||
cctxt->nsAliases = ret;
|
||||
|
||||
return(ret);
|
||||
}
|
||||
@@ -96,8 +96,8 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
|
||||
xmlChar *stylePrefix = NULL;
|
||||
xmlNsPtr literalNs = NULL;
|
||||
xmlNsPtr targetNs = NULL;
|
||||
|
||||
#ifdef XSLT_REFACTORED
|
||||
|
||||
#ifdef XSLT_REFACTORED
|
||||
xsltNsAliasPtr alias;
|
||||
|
||||
if ((style == NULL) || (node == NULL))
|
||||
@@ -118,9 +118,9 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
|
||||
/*
|
||||
* NOTE that the XSLT 2.0 also *does* use the NULL namespace if
|
||||
* "#default" is used and there's no default namespace is scope.
|
||||
* I.e., this is *not* an error.
|
||||
* I.e., this is *not* an error.
|
||||
* Most XSLT 1.0 implementations work this way.
|
||||
* The XSLT 1.0 spec has nothing to say on the subject.
|
||||
* The XSLT 1.0 spec has nothing to say on the subject.
|
||||
*/
|
||||
/*
|
||||
* Attribute "stylesheet-prefix".
|
||||
@@ -132,7 +132,7 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
|
||||
return;
|
||||
}
|
||||
if (xmlStrEqual(stylePrefix, (const xmlChar *)"#default"))
|
||||
literalNs = xmlSearchNs(node->doc, node, NULL);
|
||||
literalNs = xmlSearchNs(node->doc, node, NULL);
|
||||
else {
|
||||
literalNs = xmlSearchNs(node->doc, node, stylePrefix);
|
||||
if (literalNs == NULL) {
|
||||
@@ -151,7 +151,7 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
|
||||
xsltTransformError(NULL, style, node,
|
||||
"The attribute 'result-prefix' is missing.\n");
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
if (xmlStrEqual(resultPrefix, (const xmlChar *)"#default"))
|
||||
targetNs = xmlSearchNs(node->doc, node, NULL);
|
||||
else {
|
||||
@@ -197,8 +197,8 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
|
||||
* result-prefix="foo"/>
|
||||
* From no namespace to namespace.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Store the ns-node in the alias-object.
|
||||
*/
|
||||
@@ -213,7 +213,7 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
|
||||
#else /* XSLT_REFACTORED */
|
||||
const xmlChar *literalNsName;
|
||||
const xmlChar *targetNsName;
|
||||
|
||||
|
||||
|
||||
if ((style == NULL) || (node == NULL))
|
||||
return;
|
||||
@@ -230,7 +230,7 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
|
||||
"namespace-alias: result-prefix attribute missing\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
||||
if (xmlStrEqual(stylePrefix, (const xmlChar *)"#default")) {
|
||||
literalNs = xmlSearchNs(node->doc, node, NULL);
|
||||
if (literalNs == NULL) {
|
||||
@@ -239,7 +239,7 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
|
||||
literalNsName = literalNs->href; /* Yes - set for nsAlias table */
|
||||
} else {
|
||||
literalNs = xmlSearchNs(node->doc, node, stylePrefix);
|
||||
|
||||
|
||||
if ((literalNs == NULL) || (literalNs->href == NULL)) {
|
||||
xsltTransformError(NULL, style, node,
|
||||
"namespace-alias: prefix %s not bound to any namespace\n",
|
||||
@@ -275,13 +275,13 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
|
||||
* Special case: if #default is used for
|
||||
* the stylesheet-prefix (literal namespace) and there's no default
|
||||
* namespace in scope, we'll use style->defaultAlias for this.
|
||||
*/
|
||||
*/
|
||||
if (literalNsName == NULL) {
|
||||
if (targetNs != NULL) {
|
||||
/*
|
||||
* BUG TODO: Is it not sufficient to have only 1 field for
|
||||
* this, since subsequently alias declarations will
|
||||
* overwrite this.
|
||||
* overwrite this.
|
||||
* Example:
|
||||
* <xsl:namespace-alias result-prefix="foo"
|
||||
* stylesheet-prefix="#default"/>
|
||||
@@ -358,7 +358,7 @@ xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
|
||||
/*
|
||||
* OPTIMIZE TODO: This all could be optimized by keeping track of
|
||||
* the ns-decls currently in-scope via a specialized context.
|
||||
*/
|
||||
*/
|
||||
if ((nsPrefix == NULL) && ((nsName == NULL) || (nsName[0] == 0))) {
|
||||
/*
|
||||
* NOTE: the "undeclaration" of the default namespace was
|
||||
@@ -398,7 +398,7 @@ xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
|
||||
}
|
||||
ns = ns->next;
|
||||
} while (ns != NULL);
|
||||
}
|
||||
}
|
||||
if ((target->parent != NULL) &&
|
||||
(target->parent->type == XML_ELEMENT_NODE))
|
||||
{
|
||||
@@ -408,7 +408,7 @@ xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
|
||||
*/
|
||||
if (target->parent->ns == NULL)
|
||||
return(NULL);
|
||||
|
||||
|
||||
ns = xmlSearchNs(target->doc, target->parent,
|
||||
NULL);
|
||||
/*
|
||||
@@ -417,12 +417,12 @@ xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
|
||||
*/
|
||||
if ((ns == NULL) || (ns->href == NULL) || (ns->href[0] == 0))
|
||||
return(NULL);
|
||||
|
||||
|
||||
/*
|
||||
* Undeclare the default namespace.
|
||||
*/
|
||||
xmlNewNs(target, BAD_CAST "", NULL);
|
||||
/* TODO: Check result */
|
||||
/* TODO: Check result */
|
||||
return(NULL);
|
||||
}
|
||||
return(NULL);
|
||||
@@ -464,7 +464,7 @@ xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
|
||||
* If the ns-prefix is occupied by an other ns-decl on the
|
||||
* result element, then this means:
|
||||
* 1) The desired prefix is shadowed
|
||||
* 2) There's no way around changing the prefix
|
||||
* 2) There's no way around changing the prefix
|
||||
*
|
||||
* Try a desperate search for an in-scope ns-decl
|
||||
* with a matching ns-name before we use the last option,
|
||||
@@ -476,7 +476,7 @@ xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
|
||||
|
||||
/*
|
||||
* Fallback to changing the prefix.
|
||||
*/
|
||||
*/
|
||||
} else if ((target->parent != NULL) &&
|
||||
(target->parent->type == XML_ELEMENT_NODE))
|
||||
{
|
||||
@@ -485,12 +485,12 @@ xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
|
||||
*
|
||||
* Check the common case: The parent element of the current
|
||||
* result element is in the same namespace (with an equal ns-prefix).
|
||||
*/
|
||||
*/
|
||||
if ((target->parent->ns != NULL) &&
|
||||
((target->parent->ns->prefix != NULL) == (nsPrefix != NULL)))
|
||||
{
|
||||
ns = target->parent->ns;
|
||||
|
||||
|
||||
if (nsPrefix == NULL) {
|
||||
if (xmlStrEqual(ns->href, nsName))
|
||||
return(ns);
|
||||
@@ -502,11 +502,11 @@ xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
|
||||
}
|
||||
/*
|
||||
* Lookup the remaining in-scope namespaces.
|
||||
*/
|
||||
*/
|
||||
ns = xmlSearchNs(target->doc, target->parent, nsPrefix);
|
||||
if (ns != NULL) {
|
||||
if (xmlStrEqual(ns->href, nsName))
|
||||
return(ns);
|
||||
return(ns);
|
||||
/*
|
||||
* Now check for a nasty case: We need to ensure that the new
|
||||
* ns-decl won't shadow a prefix in-use by an existing attribute.
|
||||
@@ -633,8 +633,8 @@ declare_new_prefix:
|
||||
xmlNsPtr
|
||||
xsltGetNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns,
|
||||
xmlNodePtr out)
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
if (ns == NULL)
|
||||
return(NULL);
|
||||
|
||||
@@ -657,15 +657,15 @@ xsltGetNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns,
|
||||
style = ctxt->style;
|
||||
while (style != NULL) {
|
||||
if (style->nsAliases != NULL)
|
||||
URI = (const xmlChar *)
|
||||
URI = (const xmlChar *)
|
||||
xmlHashLookup(style->nsAliases, ns->href);
|
||||
if (URI != NULL)
|
||||
break;
|
||||
|
||||
|
||||
style = xsltNextImport(style);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (URI == UNDEFINED_DEFAULT_NS) {
|
||||
return(xsltGetSpecialNamespace(ctxt, cur, NULL, NULL, out));
|
||||
#if 0
|
||||
@@ -674,7 +674,7 @@ xsltGetNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns,
|
||||
* namespace in the stylesheet then this must resolve to
|
||||
* the NULL namespace.
|
||||
*/
|
||||
xmlNsPtr dflt;
|
||||
xmlNsPtr dflt;
|
||||
dflt = xmlSearchNs(cur->doc, cur, NULL);
|
||||
if (dflt != NULL)
|
||||
URI = dflt->href;
|
||||
@@ -696,9 +696,9 @@ xsltGetNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns,
|
||||
* @ns: the namespace
|
||||
* @out: the result element
|
||||
*
|
||||
* Obsolete.
|
||||
* Obsolete.
|
||||
* *Not* called by any Libxslt/Libexslt function.
|
||||
* Exaclty the same as xsltGetNamespace().
|
||||
* Exaclty the same as xsltGetNamespace().
|
||||
*
|
||||
* Returns a namespace declaration or NULL in case of
|
||||
* namespace fixup failures or API or internal errors.
|
||||
@@ -706,7 +706,7 @@ xsltGetNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns,
|
||||
xmlNsPtr
|
||||
xsltGetPlainNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur,
|
||||
xmlNsPtr ns, xmlNodePtr out)
|
||||
{
|
||||
{
|
||||
return(xsltGetNamespace(ctxt, cur, ns, out));
|
||||
}
|
||||
|
||||
@@ -722,7 +722,7 @@ xsltGetPlainNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur,
|
||||
* This function is intended only for *internal* use at
|
||||
* transformation-time for copying ns-declarations of Literal
|
||||
* Result Elements.
|
||||
*
|
||||
*
|
||||
* Called by:
|
||||
* xsltCopyTreeInternal() (transform.c)
|
||||
* xsltShallowCopyElem() (transform.c)
|
||||
@@ -735,7 +735,7 @@ xmlNsPtr
|
||||
xsltCopyNamespaceList(xsltTransformContextPtr ctxt, xmlNodePtr node,
|
||||
xmlNsPtr cur) {
|
||||
xmlNsPtr ret = NULL, tmp;
|
||||
xmlNsPtr p = NULL,q;
|
||||
xmlNsPtr p = NULL,q;
|
||||
|
||||
if (cur == NULL)
|
||||
return(NULL);
|
||||
@@ -759,7 +759,7 @@ xsltCopyNamespaceList(xsltTransformContextPtr ctxt, xmlNodePtr node,
|
||||
if (node != NULL) {
|
||||
if ((node->ns != NULL) &&
|
||||
(xmlStrEqual(node->ns->prefix, cur->prefix)) &&
|
||||
(xmlStrEqual(node->ns->href, cur->href))) {
|
||||
(xmlStrEqual(node->ns->href, cur->href))) {
|
||||
cur = cur->next;
|
||||
continue;
|
||||
}
|
||||
@@ -824,7 +824,7 @@ xsltCopyNamespaceList(xsltTransformContextPtr ctxt, xmlNodePtr node,
|
||||
xmlNsPtr
|
||||
xsltCopyNamespace(xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED,
|
||||
xmlNodePtr elem, xmlNsPtr ns)
|
||||
{
|
||||
{
|
||||
if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
|
||||
return(NULL);
|
||||
/*
|
||||
|
@@ -32,31 +32,31 @@ extern "C" {
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltNamespaceAlias (xsltStylesheetPtr style,
|
||||
xmlNodePtr node);
|
||||
XSLTPUBFUN xmlNsPtr XSLTCALL
|
||||
XSLTPUBFUN xmlNsPtr XSLTCALL
|
||||
xsltGetNamespace (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr cur,
|
||||
xmlNsPtr ns,
|
||||
xmlNodePtr out);
|
||||
XSLTPUBFUN xmlNsPtr XSLTCALL
|
||||
XSLTPUBFUN xmlNsPtr XSLTCALL
|
||||
xsltGetPlainNamespace (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr cur,
|
||||
xmlNsPtr ns,
|
||||
xmlNodePtr out);
|
||||
XSLTPUBFUN xmlNsPtr XSLTCALL
|
||||
XSLTPUBFUN xmlNsPtr XSLTCALL
|
||||
xsltGetSpecialNamespace (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr cur,
|
||||
const xmlChar *URI,
|
||||
const xmlChar *prefix,
|
||||
xmlNodePtr out);
|
||||
XSLTPUBFUN xmlNsPtr XSLTCALL
|
||||
XSLTPUBFUN xmlNsPtr XSLTCALL
|
||||
xsltCopyNamespace (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr elem,
|
||||
xmlNsPtr ns);
|
||||
XSLTPUBFUN xmlNsPtr XSLTCALL
|
||||
XSLTPUBFUN xmlNsPtr XSLTCALL
|
||||
xsltCopyNamespaceList (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr node,
|
||||
xmlNsPtr cur);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeNamespaceAliasHashes
|
||||
(xsltStylesheetPtr style);
|
||||
|
||||
|
@@ -193,7 +193,7 @@ xsltNumberFormatDecimal(xmlBufferPtr buffer,
|
||||
pointer -= groupingCharacterLen;
|
||||
xmlCopyCharMultiByte(pointer, groupingCharacter);
|
||||
}
|
||||
|
||||
|
||||
val = digit_zero + (int)fmod(number, 10.0);
|
||||
if (val < 0x80) { /* shortcut if ASCII */
|
||||
if (pointer <= temp_string) { /* Check enough room */
|
||||
@@ -203,7 +203,7 @@ xsltNumberFormatDecimal(xmlBufferPtr buffer,
|
||||
*(--pointer) = val;
|
||||
}
|
||||
else {
|
||||
/*
|
||||
/*
|
||||
* Here we have a multibyte character. It's a little messy,
|
||||
* because until we generate the char we don't know how long
|
||||
* it is. So, we generate it into the buffer temp_char, then
|
||||
@@ -241,7 +241,7 @@ xsltNumberFormatAlpha(xmlBufferPtr buffer,
|
||||
pointer = &temp_string[sizeof(temp_string)];
|
||||
*(--pointer) = 0;
|
||||
alpha_list = (is_upper) ? alpha_upper_list : alpha_lower_list;
|
||||
|
||||
|
||||
for (i = 1; i < (int)sizeof(temp_string); i++) {
|
||||
number--;
|
||||
*(--pointer) = alpha_list[((int)fmod(number, alpha_size))];
|
||||
@@ -337,7 +337,7 @@ xsltNumberFormatTokenize(const xmlChar *format,
|
||||
* There is always such a token in the list, even if NULL
|
||||
*/
|
||||
while (! (IS_LETTER(val=xmlStringCurrentChar(NULL, format+ix, &len)) ||
|
||||
IS_DIGIT(val)) ) {
|
||||
IS_DIGIT(val)) ) {
|
||||
if (format[ix] == 0) /* if end of format string */
|
||||
break; /* while */
|
||||
ix += len;
|
||||
@@ -632,11 +632,11 @@ xsltNumberFormatGetMultipleLevel(xsltTransformContextPtr context,
|
||||
for (ancestor = node;
|
||||
(ancestor != NULL) && (ancestor->type != XML_DOCUMENT_NODE);
|
||||
ancestor = xmlXPathNextAncestor(parser, ancestor)) {
|
||||
|
||||
|
||||
if ((fromPat != NULL) &&
|
||||
xsltTestCompMatchList(context, ancestor, fromPat))
|
||||
break; /* for */
|
||||
|
||||
|
||||
if ((countPat == NULL && node->type == ancestor->type &&
|
||||
xmlStrEqual(node->name, ancestor->name)) ||
|
||||
xsltTestCompMatchList(context, ancestor, countPat)) {
|
||||
@@ -644,7 +644,7 @@ xsltNumberFormatGetMultipleLevel(xsltTransformContextPtr context,
|
||||
cnt = 0;
|
||||
for (preceding = ancestor;
|
||||
preceding != NULL;
|
||||
preceding =
|
||||
preceding =
|
||||
xmlXPathNextPrecedingSibling(parser, preceding)) {
|
||||
if (countPat == NULL) {
|
||||
if ((preceding->type == ancestor->type) &&
|
||||
@@ -681,7 +681,7 @@ xsltNumberFormatGetValue(xmlXPathContextPtr context,
|
||||
int amount = 0;
|
||||
xmlBufferPtr pattern;
|
||||
xmlXPathObjectPtr obj;
|
||||
|
||||
|
||||
pattern = xmlBufferCreate();
|
||||
if (pattern != NULL) {
|
||||
xmlBufferCCat(pattern, "number(");
|
||||
@@ -750,9 +750,9 @@ xsltNumberFormat(xsltTransformContextPtr ctxt,
|
||||
&tokens,
|
||||
output);
|
||||
}
|
||||
|
||||
|
||||
} else if (data->level) {
|
||||
|
||||
|
||||
if (xmlStrEqual(data->level, (const xmlChar *) "single")) {
|
||||
amount = xsltNumberFormatGetMultipleLevel(ctxt,
|
||||
node,
|
||||
@@ -792,7 +792,7 @@ xsltNumberFormat(xsltTransformContextPtr ctxt,
|
||||
node,
|
||||
data->countPat,
|
||||
data->fromPat,
|
||||
&number,
|
||||
&number,
|
||||
data->doc,
|
||||
data->node);
|
||||
if (amount > 0) {
|
||||
@@ -815,7 +815,7 @@ xsltNumberFormat(xsltTransformContextPtr ctxt,
|
||||
if (tokens.tokens[i].separator != NULL)
|
||||
xmlFree(tokens.tokens[i].separator);
|
||||
}
|
||||
|
||||
|
||||
XSLT_NUMBER_FORMAT_END:
|
||||
if (tempformat == 1) {
|
||||
/* The format need to be recomputed each time */
|
||||
@@ -832,9 +832,9 @@ xsltFormatNumberPreSuffix(xsltDecimalFormatPtr self, xmlChar **format, xsltForma
|
||||
int len;
|
||||
|
||||
while (1) {
|
||||
/*
|
||||
* prefix / suffix ends at end of string or at
|
||||
* first 'special' character
|
||||
/*
|
||||
* prefix / suffix ends at end of string or at
|
||||
* first 'special' character
|
||||
*/
|
||||
if (**format == 0)
|
||||
return count;
|
||||
@@ -847,12 +847,12 @@ xsltFormatNumberPreSuffix(xsltDecimalFormatPtr self, xmlChar **format, xsltForma
|
||||
return count;
|
||||
/*
|
||||
* else treat percent/per-mille as special cases,
|
||||
* depending on whether +ve or -ve
|
||||
* depending on whether +ve or -ve
|
||||
*/
|
||||
else {
|
||||
/*
|
||||
* for +ve prefix/suffix, allow only a
|
||||
* single occurence of either
|
||||
* for +ve prefix/suffix, allow only a
|
||||
* single occurence of either
|
||||
*/
|
||||
if (xsltUTF8Charcmp(*format, self->percent) == 0) {
|
||||
if (info->is_multiplier_set)
|
||||
@@ -866,14 +866,14 @@ xsltFormatNumberPreSuffix(xsltDecimalFormatPtr self, xmlChar **format, xsltForma
|
||||
info->is_multiplier_set = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((len=xsltUTF8Size(*format)) < 1)
|
||||
return -1;
|
||||
count += len;
|
||||
*format += len;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xsltFormatNumberConversion:
|
||||
* @self: the decimal format
|
||||
@@ -932,9 +932,9 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
|
||||
int j, len;
|
||||
int self_grouping_len;
|
||||
xsltFormatNumberInfo format_info;
|
||||
/*
|
||||
/*
|
||||
* delayed_multiplier allows a 'trailing' percent or
|
||||
* permille to be treated as suffix
|
||||
* permille to be treated as suffix
|
||||
*/
|
||||
int delayed_multiplier = 0;
|
||||
/* flag to show no -ve format present for -ve number */
|
||||
@@ -990,7 +990,7 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
|
||||
|
||||
/*
|
||||
* First we process the +ve pattern to get percent / permille,
|
||||
* as well as main format
|
||||
* as well as main format
|
||||
*/
|
||||
prefix = the_format;
|
||||
prefix_length = xsltFormatNumberPreSuffix(self, &the_format, &format_info);
|
||||
@@ -999,18 +999,18 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
|
||||
goto OUTPUT_NUMBER;
|
||||
}
|
||||
|
||||
/*
|
||||
* Here we process the "number" part of the format. It gets
|
||||
/*
|
||||
* Here we process the "number" part of the format. It gets
|
||||
* a little messy because of the percent/per-mille - if that
|
||||
* appears at the end, it may be part of the suffix instead
|
||||
* of part of the number, so the variable delayed_multiplier
|
||||
* is used to handle it
|
||||
* appears at the end, it may be part of the suffix instead
|
||||
* of part of the number, so the variable delayed_multiplier
|
||||
* is used to handle it
|
||||
*/
|
||||
self_grouping_len = xmlStrlen(self->grouping);
|
||||
while ((*the_format != 0) &&
|
||||
(xsltUTF8Charcmp(the_format, self->decimalPoint) != 0) &&
|
||||
(xsltUTF8Charcmp(the_format, self->patternSeparator) != 0)) {
|
||||
|
||||
|
||||
if (delayed_multiplier != 0) {
|
||||
format_info.multiplier = delayed_multiplier;
|
||||
format_info.is_multiplier_set = TRUE;
|
||||
@@ -1048,7 +1048,7 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
|
||||
delayed_multiplier = 1000;
|
||||
} else
|
||||
break; /* while */
|
||||
|
||||
|
||||
if ((len=xsltUTF8Size(the_format)) < 1) {
|
||||
found_error = 1;
|
||||
goto OUTPUT_NUMBER;
|
||||
@@ -1062,9 +1062,9 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
|
||||
format_info.add_decimal = TRUE;
|
||||
the_format += xsltUTF8Size(the_format); /* Skip over the decimal */
|
||||
}
|
||||
|
||||
|
||||
while (*the_format != 0) {
|
||||
|
||||
|
||||
if (xsltUTF8Charcmp(the_format, self->zeroDigit) == 0) {
|
||||
if (format_info.frac_hash != 0) {
|
||||
found_error = 1;
|
||||
@@ -1112,9 +1112,9 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If delayed_multiplier is set after processing the
|
||||
* "number" part, should be in suffix
|
||||
/*
|
||||
* If delayed_multiplier is set after processing the
|
||||
* "number" part, should be in suffix
|
||||
*/
|
||||
if (delayed_multiplier != 0) {
|
||||
the_format -= len;
|
||||
@@ -1124,7 +1124,7 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
|
||||
suffix = the_format;
|
||||
suffix_length = xsltFormatNumberPreSuffix(self, &the_format, &format_info);
|
||||
if ( (suffix_length < 0) ||
|
||||
((*the_format != 0) &&
|
||||
((*the_format != 0) &&
|
||||
(xsltUTF8Charcmp(the_format, self->patternSeparator) != 0)) ) {
|
||||
found_error = 1;
|
||||
goto OUTPUT_NUMBER;
|
||||
@@ -1147,17 +1147,17 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
|
||||
else {
|
||||
/* Skip over pattern separator (accounting for UTF8) */
|
||||
the_format = (xmlChar *)xmlUTF8Strpos(format, j + 1);
|
||||
/*
|
||||
* Flag changes interpretation of percent/permille
|
||||
* in -ve pattern
|
||||
/*
|
||||
* Flag changes interpretation of percent/permille
|
||||
* in -ve pattern
|
||||
*/
|
||||
format_info.is_negative_pattern = TRUE;
|
||||
format_info.is_multiplier_set = FALSE;
|
||||
|
||||
/* First do the -ve prefix */
|
||||
nprefix = the_format;
|
||||
nprefix_length = xsltFormatNumberPreSuffix(self,
|
||||
&the_format, &format_info);
|
||||
nprefix_length = xsltFormatNumberPreSuffix(self,
|
||||
&the_format, &format_info);
|
||||
if (nprefix_length<0) {
|
||||
found_error = 1;
|
||||
goto OUTPUT_NUMBER;
|
||||
@@ -1191,7 +1191,7 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
|
||||
/* Finally do the -ve suffix */
|
||||
if (*the_format != 0) {
|
||||
nsuffix = the_format;
|
||||
nsuffix_length = xsltFormatNumberPreSuffix(self,
|
||||
nsuffix_length = xsltFormatNumberPreSuffix(self,
|
||||
&the_format, &format_info);
|
||||
if (nsuffix_length < 0) {
|
||||
found_error = 1;
|
||||
@@ -1209,12 +1209,12 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
|
||||
* if -ve prefix/suffix == +ve ones, discard & use default
|
||||
*/
|
||||
if ((nprefix_length != prefix_length) ||
|
||||
(nsuffix_length != suffix_length) ||
|
||||
((nprefix_length > 0) &&
|
||||
(nsuffix_length != suffix_length) ||
|
||||
((nprefix_length > 0) &&
|
||||
(xmlStrncmp(nprefix, prefix, prefix_length) !=0 )) ||
|
||||
((nsuffix_length > 0) &&
|
||||
((nsuffix_length > 0) &&
|
||||
(xmlStrncmp(nsuffix, suffix, suffix_length) !=0 ))) {
|
||||
prefix = nprefix;
|
||||
prefix = nprefix;
|
||||
prefix_length = nprefix_length;
|
||||
suffix = nsuffix;
|
||||
suffix_length = nsuffix_length;
|
||||
@@ -1260,9 +1260,9 @@ OUTPUT_NUMBER:
|
||||
number = fabs(number) * (double)format_info.multiplier;
|
||||
scale = pow(10.0, (double)(format_info.frac_digits + format_info.frac_hash));
|
||||
number = floor((scale * number + 0.5)) / scale;
|
||||
if ((self->grouping != NULL) &&
|
||||
if ((self->grouping != NULL) &&
|
||||
(self->grouping[0] != 0)) {
|
||||
|
||||
|
||||
len = xmlStrlen(self->grouping);
|
||||
pchar = xsltGetUTF8Char(self->grouping, &len);
|
||||
xsltNumberFormatDecimal(buffer, floor(number), self->zeroDigit[0],
|
||||
@@ -1291,14 +1291,14 @@ OUTPUT_NUMBER:
|
||||
/* Next the fractional part, if required */
|
||||
if (format_info.frac_digits + format_info.frac_hash == 0) {
|
||||
if (format_info.add_decimal)
|
||||
xmlBufferAdd(buffer, self->decimalPoint,
|
||||
xsltUTF8Size(self->decimalPoint));
|
||||
xmlBufferAdd(buffer, self->decimalPoint,
|
||||
xsltUTF8Size(self->decimalPoint));
|
||||
}
|
||||
else {
|
||||
number -= floor(number);
|
||||
if ((number != 0) || (format_info.frac_digits != 0)) {
|
||||
xmlBufferAdd(buffer, self->decimalPoint,
|
||||
xsltUTF8Size(self->decimalPoint));
|
||||
xsltUTF8Size(self->decimalPoint));
|
||||
number = floor(scale * number + 0.5);
|
||||
for (j = format_info.frac_hash; j > 0; j--) {
|
||||
if (fmod(number, 10.0) >= 1.0)
|
||||
|
@@ -26,7 +26,7 @@ struct _xsltCompMatch;
|
||||
*/
|
||||
typedef struct _xsltNumberData xsltNumberData;
|
||||
typedef xsltNumberData *xsltNumberDataPtr;
|
||||
|
||||
|
||||
struct _xsltNumberData {
|
||||
const xmlChar *level;
|
||||
const xmlChar *count;
|
||||
|
@@ -128,9 +128,9 @@ struct _xsltParserContext {
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Type functions *
|
||||
* *
|
||||
* *
|
||||
* Type functions *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -373,7 +373,7 @@ xsltSwapTopCompMatch(xsltCompMatchPtr comp) {
|
||||
if (j > 0) {
|
||||
register xmlChar *tmp;
|
||||
register xsltOp op;
|
||||
register xmlXPathCompExprPtr expr;
|
||||
register xmlXPathCompExprPtr expr;
|
||||
register int t;
|
||||
i = j - 1;
|
||||
tmp = comp->steps[i].value;
|
||||
@@ -474,9 +474,9 @@ xsltReverseCompMatch(xsltParserContextPtr ctxt, xsltCompMatchPtr comp) {
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* The interpreter for the precompiled patterns *
|
||||
* *
|
||||
* *
|
||||
* The interpreter for the precompiled patterns *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
static int
|
||||
@@ -545,7 +545,7 @@ xsltTestCompMatchDirect(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp,
|
||||
ix = XSLT_RUNTIME_EXTRA(ctxt, sel->indexExtra, ival);
|
||||
list = (xmlXPathObjectPtr)
|
||||
XSLT_RUNTIME_EXTRA_LST(ctxt, sel->lenExtra);
|
||||
|
||||
|
||||
if ((list == NULL) || (prevdoc != doc)) {
|
||||
xmlXPathObjectPtr newlist;
|
||||
xmlNodePtr parent = node->parent;
|
||||
@@ -581,7 +581,7 @@ xsltTestCompMatchDirect(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp,
|
||||
|
||||
if ((parent == NULL) || (node->doc == NULL) || isRVT)
|
||||
nocache = 1;
|
||||
|
||||
|
||||
if (nocache == 0) {
|
||||
if (list != NULL)
|
||||
xmlXPathFreeObject(list);
|
||||
@@ -763,8 +763,8 @@ restart:
|
||||
if (step->op == XSLT_OP_ROOT)
|
||||
goto found;
|
||||
/* added NS, ID and KEY as a result of bug 168208 */
|
||||
if ((step->op != XSLT_OP_ELEM) &&
|
||||
(step->op != XSLT_OP_ALL) &&
|
||||
if ((step->op != XSLT_OP_ELEM) &&
|
||||
(step->op != XSLT_OP_ALL) &&
|
||||
(step->op != XSLT_OP_NS) &&
|
||||
(step->op != XSLT_OP_ID) &&
|
||||
(step->op != XSLT_OP_KEY))
|
||||
@@ -872,7 +872,7 @@ restart:
|
||||
xmlFree(states.states);
|
||||
}
|
||||
return(xsltTestCompMatchDirect(ctxt, comp, node,
|
||||
comp->nsList, comp->nsNr));
|
||||
comp->nsList, comp->nsNr));
|
||||
}
|
||||
|
||||
doc = node->doc;
|
||||
@@ -1235,17 +1235,17 @@ xsltTestCompMatchList(xsltTransformContextPtr ctxt, xmlNodePtr node,
|
||||
#define NXT(val) ctxt->cur[(val)]
|
||||
#define CUR_PTR ctxt->cur
|
||||
|
||||
#define SKIP_BLANKS \
|
||||
#define SKIP_BLANKS \
|
||||
while (IS_BLANK_CH(CUR)) NEXT
|
||||
|
||||
#define CURRENT (*ctxt->cur)
|
||||
#define NEXT ((*ctxt->cur) ? ctxt->cur++: ctxt->cur)
|
||||
|
||||
|
||||
#define PUSH(op, val, val2, novar) \
|
||||
#define PUSH(op, val, val2, novar) \
|
||||
if (xsltCompMatchAdd(ctxt, ctxt->comp, (op), (val), (val2), (novar))) goto error;
|
||||
|
||||
#define SWAP() \
|
||||
#define SWAP() \
|
||||
xsltSwapTopCompMatch(ctxt->comp);
|
||||
|
||||
#define XSLT_ERROR(X) \
|
||||
@@ -1533,7 +1533,7 @@ error:
|
||||
* Compile the XSLT StepPattern and generates a precompiled
|
||||
* form suitable for fast matching.
|
||||
*
|
||||
* [5] StepPattern ::= ChildOrAttributeAxisSpecifier NodeTest Predicate*
|
||||
* [5] StepPattern ::= ChildOrAttributeAxisSpecifier NodeTest Predicate*
|
||||
* [6] ChildOrAttributeAxisSpecifier ::= AbbreviatedAxisSpecifier
|
||||
* | ('child' | 'attribute') '::'
|
||||
* from XPath
|
||||
@@ -2087,12 +2087,12 @@ xsltAddTemplate(xsltStylesheetPtr style, xsltTemplatePtr cur,
|
||||
pat = xsltCompilePatternInternal(cur->match, style->doc, cur->elem,
|
||||
style, NULL, 1);
|
||||
if (pat == NULL)
|
||||
return(-1);
|
||||
return(-1);
|
||||
while (pat) {
|
||||
next = pat->next;
|
||||
pat->next = NULL;
|
||||
name = NULL;
|
||||
|
||||
|
||||
pat->template = cur;
|
||||
if (mode != NULL)
|
||||
pat->mode = xmlDictLookup(style->dict, mode, -1);
|
||||
@@ -2479,7 +2479,7 @@ keyed_match:
|
||||
goto error;
|
||||
|
||||
switch (node->type) {
|
||||
case XML_ELEMENT_NODE:
|
||||
case XML_ELEMENT_NODE:
|
||||
if (node->psvi != NULL) keyed = 1;
|
||||
break;
|
||||
case XML_ATTRIBUTE_NODE:
|
||||
@@ -2488,13 +2488,13 @@ keyed_match:
|
||||
case XML_TEXT_NODE:
|
||||
case XML_CDATA_SECTION_NODE:
|
||||
case XML_COMMENT_NODE:
|
||||
case XML_PI_NODE:
|
||||
case XML_PI_NODE:
|
||||
if (node->psvi != NULL) keyed = 1;
|
||||
break;
|
||||
case XML_DOCUMENT_NODE:
|
||||
case XML_HTML_DOCUMENT_NODE:
|
||||
if (((xmlDocPtr) node)->psvi != NULL) keyed = 1;
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@@ -73,7 +73,7 @@ xsltCheckTopLevelElement(xsltStylesheetPtr style, xmlNodePtr inst, int err) {
|
||||
xmlNodePtr parent;
|
||||
if ((style == NULL) || (inst == NULL) || (inst->ns == NULL))
|
||||
return(-1);
|
||||
|
||||
|
||||
parent = inst->parent;
|
||||
if (parent == NULL) {
|
||||
if (err) {
|
||||
@@ -116,7 +116,7 @@ xsltCheckInstructionElement(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
return;
|
||||
|
||||
has_ext = (style->extInfos != NULL);
|
||||
|
||||
|
||||
parent = inst->parent;
|
||||
if (parent == NULL) {
|
||||
xsltTransformError(NULL, style, inst,
|
||||
@@ -142,7 +142,7 @@ xsltCheckInstructionElement(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
if ((has_ext) && (parent->ns != NULL) &&
|
||||
(xmlHashLookup(style->extInfos, parent->ns->href) != NULL))
|
||||
return;
|
||||
|
||||
|
||||
parent = parent->parent;
|
||||
}
|
||||
xsltTransformError(NULL, style, inst,
|
||||
@@ -194,7 +194,7 @@ xsltCheckParentElement(xsltStylesheetPtr style, xmlNodePtr inst,
|
||||
if ((parent->ns != NULL) &&
|
||||
(xmlHashLookup(style->extInfos, parent->ns->href) != NULL))
|
||||
return;
|
||||
|
||||
|
||||
parent = parent->parent;
|
||||
}
|
||||
}
|
||||
@@ -230,7 +230,7 @@ xsltNewStylePreComp(xsltStylesheetPtr style, xsltStyleType type) {
|
||||
|
||||
if (style == NULL)
|
||||
return(NULL);
|
||||
|
||||
|
||||
#ifdef XSLT_REFACTORED
|
||||
/*
|
||||
* URGENT TODO: Use specialized factory functions in order
|
||||
@@ -281,7 +281,7 @@ xsltNewStylePreComp(xsltStylesheetPtr style, xsltStyleType type) {
|
||||
size = sizeof(xsltStyleItemWhen); break;
|
||||
case XSLT_FUNC_OTHERWISE:
|
||||
size = sizeof(xsltStyleItemOtherwise); break;
|
||||
default:
|
||||
default:
|
||||
xsltTransformError(NULL, style, NULL,
|
||||
"xsltNewStylePreComp : invalid type %d\n", type);
|
||||
style->errors++;
|
||||
@@ -354,8 +354,8 @@ xsltNewStylePreComp(xsltStylesheetPtr style, xsltStyleType type) {
|
||||
case XSLT_FUNC_DOCUMENT:
|
||||
cur->func = (xsltTransformFunction) xsltDocumentElem;break;
|
||||
case XSLT_FUNC_WITHPARAM:
|
||||
case XSLT_FUNC_PARAM:
|
||||
case XSLT_FUNC_VARIABLE:
|
||||
case XSLT_FUNC_PARAM:
|
||||
case XSLT_FUNC_VARIABLE:
|
||||
case XSLT_FUNC_WHEN:
|
||||
break;
|
||||
default:
|
||||
@@ -484,18 +484,18 @@ xsltFreeStylePreComp(xsltStylePreCompPtr comp) {
|
||||
xmlXPathFreeCompExpr(item->comp);
|
||||
}
|
||||
break;
|
||||
case XSLT_FUNC_OTHERWISE:
|
||||
case XSLT_FUNC_OTHERWISE:
|
||||
case XSLT_FUNC_FALLBACK:
|
||||
case XSLT_FUNC_MESSAGE:
|
||||
case XSLT_FUNC_INCLUDE:
|
||||
case XSLT_FUNC_ATTRSET:
|
||||
|
||||
|
||||
break;
|
||||
default:
|
||||
/* TODO: Raise error. */
|
||||
break;
|
||||
}
|
||||
#else
|
||||
#else
|
||||
if (comp->locale != (xsltLocale)0)
|
||||
xsltFreeLocale(comp->locale);
|
||||
if (comp->comp != NULL)
|
||||
@@ -556,7 +556,7 @@ xsltDocumentComp(xsltStylesheetPtr style, xmlNodePtr inst,
|
||||
#else
|
||||
comp = xsltNewStylePreComp(style, XSLT_FUNC_DOCUMENT);
|
||||
#endif
|
||||
|
||||
|
||||
if (comp == NULL)
|
||||
return (NULL);
|
||||
comp->inst = inst;
|
||||
@@ -603,8 +603,8 @@ xsltDocumentComp(xsltStylesheetPtr style, xmlNodePtr inst,
|
||||
#ifdef WITH_XSLT_DEBUG_EXTRA
|
||||
xsltGenericDebug(xsltGenericDebugContext,
|
||||
"Found xslt11:document construct\n");
|
||||
#endif
|
||||
} else {
|
||||
#endif
|
||||
} else {
|
||||
if (xmlStrEqual(inst->ns->href,
|
||||
(const xmlChar *)"http://exslt.org/common")) {
|
||||
/* EXSLT. */
|
||||
@@ -645,12 +645,12 @@ xsltDocumentComp(xsltStylesheetPtr style, xmlNodePtr inst,
|
||||
* 3) XSLT_XT_NAMESPACE (http://www.jclark.com/xt)
|
||||
* Example: <xt:document method="xml" href="myFile.xml">
|
||||
* TODO: is @href is an AVT?
|
||||
*
|
||||
*
|
||||
* In all cases @href is in no namespace.
|
||||
*/
|
||||
filename = xsltEvalStaticAttrValueTemplate(style, inst,
|
||||
(const xmlChar *)"href", NULL, &comp->has_filename);
|
||||
}
|
||||
}
|
||||
if (!comp->has_filename) {
|
||||
goto error;
|
||||
}
|
||||
@@ -688,7 +688,7 @@ xsltSortComp(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
#else
|
||||
comp = xsltNewStylePreComp(style, XSLT_FUNC_SORT);
|
||||
#endif
|
||||
|
||||
|
||||
if (comp == NULL)
|
||||
return;
|
||||
inst->psvi = comp;
|
||||
@@ -795,7 +795,7 @@ xsltCopyComp(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
#else
|
||||
comp = xsltNewStylePreComp(style, XSLT_FUNC_COPY);
|
||||
#endif
|
||||
|
||||
|
||||
if (comp == NULL)
|
||||
return;
|
||||
inst->psvi = comp;
|
||||
@@ -839,7 +839,7 @@ xsltTextComp(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
comp = (xsltStyleItemTextPtr) xsltNewStylePreComp(style, XSLT_FUNC_TEXT);
|
||||
#else
|
||||
comp = xsltNewStylePreComp(style, XSLT_FUNC_TEXT);
|
||||
#endif
|
||||
#endif
|
||||
if (comp == NULL)
|
||||
return;
|
||||
inst->psvi = comp;
|
||||
@@ -921,8 +921,8 @@ xsltElementComp(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
*/
|
||||
comp->ns = xsltEvalStaticAttrValueTemplate(style, inst,
|
||||
(const xmlChar *)"namespace", NULL, &comp->has_ns);
|
||||
|
||||
if (comp->name != NULL) {
|
||||
|
||||
if (comp->name != NULL) {
|
||||
if (xmlValidateQName(comp->name, 0)) {
|
||||
xsltTransformError(NULL, style, inst,
|
||||
"xsl:element: The value '%s' of the attribute 'name' is "
|
||||
@@ -932,7 +932,7 @@ xsltElementComp(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
const xmlChar *prefix = NULL, *name;
|
||||
|
||||
name = xsltSplitQName(style->dict, comp->name, &prefix);
|
||||
if (comp->has_ns == 0) {
|
||||
if (comp->has_ns == 0) {
|
||||
xmlNsPtr ns;
|
||||
|
||||
/*
|
||||
@@ -941,7 +941,7 @@ xsltElementComp(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
* expanded into an expanded-name using the namespace declarations
|
||||
* in effect for the xsl:element element, including any default
|
||||
* namespace declaration.
|
||||
*/
|
||||
*/
|
||||
ns = xmlSearchNs(inst->doc, inst, prefix);
|
||||
if (ns != NULL) {
|
||||
comp->ns = xmlDictLookup(style->dict, ns->href, -1);
|
||||
@@ -958,17 +958,17 @@ xsltElementComp(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
"not specified by the instruction itself.\n", comp->name);
|
||||
style->errors++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((prefix != NULL) &&
|
||||
(!xmlStrncasecmp(prefix, (xmlChar *)"xml", 3)))
|
||||
{
|
||||
/*
|
||||
* Mark is to be skipped.
|
||||
*/
|
||||
comp->has_name = 0;
|
||||
comp->has_name = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Attribute "use-attribute-sets",
|
||||
*/
|
||||
@@ -976,7 +976,7 @@ xsltElementComp(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
(const xmlChar *)"use-attribute-sets",
|
||||
NULL, &comp->has_use);
|
||||
|
||||
error:
|
||||
error:
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1011,7 +1011,7 @@ xsltAttributeComp(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
#else
|
||||
comp = xsltNewStylePreComp(style, XSLT_FUNC_ATTRIBUTE);
|
||||
#endif
|
||||
|
||||
|
||||
if (comp == NULL)
|
||||
return;
|
||||
inst->psvi = comp;
|
||||
@@ -1031,7 +1031,7 @@ xsltAttributeComp(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
"XSLT-attribute: The attribute 'name' is missing.\n");
|
||||
style->errors++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Attribute "namespace".
|
||||
*/
|
||||
@@ -1066,7 +1066,7 @@ xsltAttributeComp(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
* QName is expanded into an expanded-name using the
|
||||
* namespace declarations in effect for the xsl:element
|
||||
* element, including any default namespace declaration.
|
||||
*/
|
||||
*/
|
||||
ns = xmlSearchNs(inst->doc, inst, prefix);
|
||||
if (ns != NULL) {
|
||||
comp->ns = xmlDictLookup(style->dict, ns->href, -1);
|
||||
@@ -1086,7 +1086,7 @@ xsltAttributeComp(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1459,14 +1459,14 @@ xsltNumberComp(xsltStylesheetPtr style, xmlNodePtr cur) {
|
||||
if (style != NULL) style->warnings++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
prop = xsltGetCNsProp(style, cur, (const xmlChar *)"lang", XSLT_NAMESPACE);
|
||||
if (prop != NULL) {
|
||||
xsltTransformError(NULL, style, cur,
|
||||
"xsl:number : lang attribute not implemented\n");
|
||||
XSLT_TODO; /* xsl:number lang attribute */
|
||||
}
|
||||
|
||||
|
||||
prop = xsltGetCNsProp(style, cur, (const xmlChar *)"letter-value", XSLT_NAMESPACE);
|
||||
if (prop != NULL) {
|
||||
if (xmlStrEqual(prop, BAD_CAST("alphabetic"))) {
|
||||
@@ -1485,7 +1485,7 @@ xsltNumberComp(xsltStylesheetPtr style, xmlNodePtr cur) {
|
||||
if (style != NULL) style->warnings++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
prop = xsltGetCNsProp(style, cur, (const xmlChar *)"grouping-separator",
|
||||
XSLT_NAMESPACE);
|
||||
if (prop != NULL) {
|
||||
@@ -1493,7 +1493,7 @@ xsltNumberComp(xsltStylesheetPtr style, xmlNodePtr cur) {
|
||||
comp->numdata.groupingCharacter =
|
||||
xsltGetUTF8Char(prop, &(comp->numdata.groupingCharacterLen));
|
||||
}
|
||||
|
||||
|
||||
prop = xsltGetCNsProp(style, cur, (const xmlChar *)"grouping-size", XSLT_NAMESPACE);
|
||||
if (prop != NULL) {
|
||||
sscanf((char *)prop, "%d", &comp->numdata.digitsPerGroup);
|
||||
@@ -1508,7 +1508,7 @@ xsltNumberComp(xsltStylesheetPtr style, xmlNodePtr cur) {
|
||||
BAD_CAST"single", 6);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1843,7 +1843,7 @@ xsltVariableComp(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
xsltGetQNameProperty(style, inst, BAD_CAST "name",
|
||||
1, &(comp->has_name), &(comp->ns), &(comp->name));
|
||||
if (comp->ns)
|
||||
comp->has_ns = 1;
|
||||
comp->has_ns = 1;
|
||||
/*
|
||||
* Attribute "select".
|
||||
*/
|
||||
@@ -1958,11 +1958,11 @@ xsltFreeStylePreComps(xsltStylesheetPtr style) {
|
||||
xsltElemPreCompPtr cur, next;
|
||||
|
||||
if (style == NULL)
|
||||
return;
|
||||
|
||||
return;
|
||||
|
||||
cur = style->preComps;
|
||||
while (cur != NULL) {
|
||||
next = cur->next;
|
||||
next = cur->next;
|
||||
if (cur->type == XSLT_FUNC_EXTENSION)
|
||||
cur->free(cur);
|
||||
else
|
||||
@@ -1984,7 +1984,7 @@ xsltFreeStylePreComps(xsltStylesheetPtr style) {
|
||||
*/
|
||||
void
|
||||
xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
|
||||
/*
|
||||
/*
|
||||
* The xsltXSLTElemMarker marker was set beforehand by
|
||||
* the parsing mechanism for all elements in the XSLT namespace.
|
||||
*/
|
||||
@@ -2004,67 +2004,67 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
|
||||
case XSLT_FUNC_APPLYTEMPLATES:
|
||||
xsltApplyTemplatesComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_WITHPARAM:
|
||||
case XSLT_FUNC_WITHPARAM:
|
||||
xsltWithParamComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_VALUEOF:
|
||||
case XSLT_FUNC_VALUEOF:
|
||||
xsltValueOfComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_COPY:
|
||||
case XSLT_FUNC_COPY:
|
||||
xsltCopyComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_COPYOF:
|
||||
xsltCopyOfComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_IF:
|
||||
case XSLT_FUNC_IF:
|
||||
xsltIfComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_CHOOSE:
|
||||
case XSLT_FUNC_CHOOSE:
|
||||
xsltChooseComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_WHEN:
|
||||
case XSLT_FUNC_WHEN:
|
||||
xsltWhenComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_OTHERWISE:
|
||||
case XSLT_FUNC_OTHERWISE:
|
||||
/* NOP yet */
|
||||
return;
|
||||
case XSLT_FUNC_FOREACH:
|
||||
case XSLT_FUNC_FOREACH:
|
||||
xsltForEachComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_APPLYIMPORTS:
|
||||
case XSLT_FUNC_APPLYIMPORTS:
|
||||
xsltApplyImportsComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_ATTRIBUTE:
|
||||
case XSLT_FUNC_ATTRIBUTE:
|
||||
xsltAttributeComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_ELEMENT:
|
||||
case XSLT_FUNC_ELEMENT:
|
||||
xsltElementComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_SORT:
|
||||
case XSLT_FUNC_SORT:
|
||||
xsltSortComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_COMMENT:
|
||||
case XSLT_FUNC_COMMENT:
|
||||
xsltCommentComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_NUMBER:
|
||||
case XSLT_FUNC_NUMBER:
|
||||
xsltNumberComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_PI:
|
||||
case XSLT_FUNC_PI:
|
||||
xsltProcessingInstructionComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_CALLTEMPLATE:
|
||||
case XSLT_FUNC_CALLTEMPLATE:
|
||||
xsltCallTemplateComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_PARAM:
|
||||
case XSLT_FUNC_PARAM:
|
||||
xsltParamComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_VARIABLE:
|
||||
case XSLT_FUNC_VARIABLE:
|
||||
xsltVariableComp(style, node);
|
||||
break;
|
||||
case XSLT_FUNC_FALLBACK:
|
||||
case XSLT_FUNC_FALLBACK:
|
||||
/* NOP yet */
|
||||
return;
|
||||
case XSLT_FUNC_DOCUMENT:
|
||||
case XSLT_FUNC_DOCUMENT:
|
||||
/* The extra one */
|
||||
node->psvi = (void *) xsltDocumentComp(style, node,
|
||||
(xsltTransformFunction) xsltDocumentElem);
|
||||
@@ -2087,7 +2087,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
|
||||
} else {
|
||||
/*
|
||||
* Fallback to string comparison.
|
||||
*/
|
||||
*/
|
||||
if (IS_XSLT_NAME(node, "apply-templates")) {
|
||||
xsltApplyTemplatesComp(style, node);
|
||||
} else if (IS_XSLT_NAME(node, "with-param")) {
|
||||
@@ -2103,7 +2103,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
|
||||
} else if (IS_XSLT_NAME(node, "choose")) {
|
||||
xsltChooseComp(style, node);
|
||||
} else if (IS_XSLT_NAME(node, "when")) {
|
||||
xsltWhenComp(style, node);
|
||||
xsltWhenComp(style, node);
|
||||
} else if (IS_XSLT_NAME(node, "otherwise")) {
|
||||
/* NOP yet */
|
||||
return;
|
||||
@@ -2135,7 +2135,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
|
||||
} else if (IS_XSLT_NAME(node, "document")) {
|
||||
/* The extra one */
|
||||
node->psvi = (void *) xsltDocumentComp(style, node,
|
||||
(xsltTransformFunction) xsltDocumentElem);
|
||||
(xsltTransformFunction) xsltDocumentElem);
|
||||
} else if (IS_XSLT_NAME(node, "output")) {
|
||||
/* Top-level */
|
||||
return;
|
||||
@@ -2144,7 +2144,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
|
||||
return;
|
||||
} else if (IS_XSLT_NAME(node, "strip-space")) {
|
||||
/* Top-level */
|
||||
return;
|
||||
return;
|
||||
} else if (IS_XSLT_NAME(node, "key")) {
|
||||
/* Top-level */
|
||||
return;
|
||||
@@ -2160,7 +2160,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
|
||||
/* Top-level */
|
||||
return;
|
||||
} else if (IS_XSLT_NAME(node, "include")) {
|
||||
/* Top-level */
|
||||
/* Top-level */
|
||||
} else {
|
||||
/*
|
||||
* NOTE that xsl:text, xsl:template, xsl:stylesheet,
|
||||
@@ -2172,7 +2172,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
|
||||
"the XSLT element '%s'.\n", node->name);
|
||||
style->errors++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Assign the current list of in-scope namespaces to the
|
||||
@@ -2274,7 +2274,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
} else if (IS_XSLT_NAME(inst, "call-template")) {
|
||||
xsltCheckInstructionElement(style, inst);
|
||||
xsltCallTemplateComp(style, inst);
|
||||
} else if (IS_XSLT_NAME(inst, "param")) {
|
||||
} else if (IS_XSLT_NAME(inst, "param")) {
|
||||
if (xsltCheckTopLevelElement(style, inst, 0) == 0)
|
||||
xsltCheckInstructionElement(style, inst);
|
||||
xsltParamComp(style, inst);
|
||||
@@ -2342,7 +2342,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr inst) {
|
||||
"xsltStylePreCompute: unknown xsl:%s\n", inst->name);
|
||||
if (style != NULL) style->warnings++;
|
||||
}
|
||||
|
||||
|
||||
cur = (xsltStylePreCompPtr) inst->psvi;
|
||||
/*
|
||||
* A ns-list is build for every XSLT item in the
|
||||
|
@@ -24,15 +24,15 @@ extern "C" {
|
||||
*/
|
||||
extern const xmlChar *xsltExtMarker;
|
||||
|
||||
XSLTPUBFUN xsltElemPreCompPtr XSLTCALL
|
||||
XSLTPUBFUN xsltElemPreCompPtr XSLTCALL
|
||||
xsltDocumentComp (xsltStylesheetPtr style,
|
||||
xmlNodePtr inst,
|
||||
xsltTransformFunction function);
|
||||
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltStylePreCompute (xsltStylesheetPtr style,
|
||||
xmlNodePtr inst);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeStylePreComps (xsltStylesheetPtr style);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -181,7 +181,7 @@ xsltGetSecurityPrefs(xsltSecurityPrefsPtr sec, xsltSecurityOption option) {
|
||||
*/
|
||||
void
|
||||
xsltSetDefaultSecurityPrefs(xsltSecurityPrefsPtr sec) {
|
||||
|
||||
|
||||
xsltDefaultSecurityPrefs = sec;
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ xsltGetDefaultSecurityPrefs(void) {
|
||||
*
|
||||
* Returns -1 in case of error, 0 otherwise
|
||||
*/
|
||||
int
|
||||
int
|
||||
xsltSetCtxtSecurityPrefs(xsltSecurityPrefsPtr sec,
|
||||
xsltTransformContextPtr ctxt) {
|
||||
if (ctxt == NULL)
|
||||
@@ -265,7 +265,7 @@ xsltSecurityForbid(xsltSecurityPrefsPtr sec ATTRIBUTE_UNUSED,
|
||||
*
|
||||
* TODO: remove at some point !!!
|
||||
* Local copy of xmlCheckFilename to avoid a hard dependency on
|
||||
* a new version of libxml2
|
||||
* a new version of libxml2
|
||||
*
|
||||
* if stat is not available on the target machine,
|
||||
* returns 1. if stat fails, returns 0 (if calling
|
||||
@@ -282,7 +282,7 @@ xsltCheckFilename (const char *path)
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
DWORD dwAttrs;
|
||||
|
||||
dwAttrs = GetFileAttributes(path);
|
||||
dwAttrs = GetFileAttributes(path);
|
||||
if (dwAttrs != INVALID_FILE_ATTRIBUTES) {
|
||||
if (dwAttrs & FILE_ATTRIBUTE_DIRECTORY) {
|
||||
return 2;
|
||||
|
@@ -55,43 +55,43 @@ typedef int (*xsltSecurityCheck) (xsltSecurityPrefsPtr sec,
|
||||
/*
|
||||
* Module interfaces
|
||||
*/
|
||||
XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL
|
||||
XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL
|
||||
xsltNewSecurityPrefs (void);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeSecurityPrefs (xsltSecurityPrefsPtr sec);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSetSecurityPrefs (xsltSecurityPrefsPtr sec,
|
||||
xsltSecurityOption option,
|
||||
xsltSecurityCheck func);
|
||||
XSLTPUBFUN xsltSecurityCheck XSLTCALL
|
||||
XSLTPUBFUN xsltSecurityCheck XSLTCALL
|
||||
xsltGetSecurityPrefs (xsltSecurityPrefsPtr sec,
|
||||
xsltSecurityOption option);
|
||||
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSetDefaultSecurityPrefs (xsltSecurityPrefsPtr sec);
|
||||
XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL
|
||||
XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL
|
||||
xsltGetDefaultSecurityPrefs (void);
|
||||
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSetCtxtSecurityPrefs (xsltSecurityPrefsPtr sec,
|
||||
xsltTransformContextPtr ctxt);
|
||||
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSecurityAllow (xsltSecurityPrefsPtr sec,
|
||||
xsltTransformContextPtr ctxt,
|
||||
const char *value);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSecurityForbid (xsltSecurityPrefsPtr sec,
|
||||
xsltTransformContextPtr ctxt,
|
||||
const char *value);
|
||||
/*
|
||||
* internal interfaces
|
||||
*/
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltCheckWrite (xsltSecurityPrefsPtr sec,
|
||||
xsltTransformContextPtr ctxt,
|
||||
const xmlChar *URL);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltCheckRead (xsltSecurityPrefsPtr sec,
|
||||
xsltTransformContextPtr ctxt,
|
||||
const xmlChar *URL);
|
||||
|
@@ -40,7 +40,7 @@
|
||||
* Module interfaces *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* xsltEvalXPathPredicate:
|
||||
* @ctxt: the XSLT transformation context
|
||||
@@ -468,7 +468,7 @@ xsltEvalStaticAttrValueTemplate(xsltStylesheetPtr style, xmlNodePtr inst,
|
||||
* Evaluates Attribute Value Templates and copies the attribute over to
|
||||
* the result element.
|
||||
* This does *not* process attribute sets (xsl:use-attribute-set).
|
||||
*
|
||||
*
|
||||
*
|
||||
* Returns the generated attribute node.
|
||||
*/
|
||||
@@ -482,14 +482,14 @@ xsltAttrTemplateProcess(xsltTransformContextPtr ctxt, xmlNodePtr target,
|
||||
if ((ctxt == NULL) || (attr == NULL) || (target == NULL) ||
|
||||
(target->type != XML_ELEMENT_NODE))
|
||||
return(NULL);
|
||||
|
||||
|
||||
if (attr->type != XML_ATTRIBUTE_NODE)
|
||||
return(NULL);
|
||||
|
||||
/*
|
||||
* Skip all XSLT attributes.
|
||||
*/
|
||||
#ifdef XSLT_REFACTORED
|
||||
#ifdef XSLT_REFACTORED
|
||||
if (attr->psvi == xsltXSLTAttrMarker)
|
||||
return(NULL);
|
||||
#else
|
||||
@@ -526,7 +526,7 @@ xsltAttrTemplateProcess(xsltTransformContextPtr ctxt, xmlNodePtr target,
|
||||
}
|
||||
ret = ret->next;
|
||||
}
|
||||
if (ret != NULL) {
|
||||
if (ret != NULL) {
|
||||
/* free the existing value */
|
||||
xmlFreeNodeList(ret->children);
|
||||
ret->children = ret->last = NULL;
|
||||
@@ -545,7 +545,7 @@ xsltAttrTemplateProcess(xsltTransformContextPtr ctxt, xmlNodePtr target,
|
||||
xsltGetNamespace(ctxt, attr->parent, attr->ns, target),
|
||||
attr->name, NULL);
|
||||
else
|
||||
ret = xmlNewNsProp(target, NULL, attr->name, NULL);
|
||||
ret = xmlNewNsProp(target, NULL, attr->name, NULL);
|
||||
}
|
||||
/*
|
||||
* Set the value.
|
||||
@@ -597,11 +597,11 @@ xsltAttrTemplateProcess(xsltTransformContextPtr ctxt, xmlNodePtr target,
|
||||
} else {
|
||||
if (attr->ns) {
|
||||
xsltTransformError(ctxt, NULL, attr->parent,
|
||||
"Internal error: Failed to create attribute '{%s}%s'.\n",
|
||||
"Internal error: Failed to create attribute '{%s}%s'.\n",
|
||||
attr->ns->href, attr->name);
|
||||
} else {
|
||||
xsltTransformError(ctxt, NULL, attr->parent,
|
||||
"Internal error: Failed to create attribute '%s'.\n",
|
||||
"Internal error: Failed to create attribute '%s'.\n",
|
||||
attr->name);
|
||||
}
|
||||
}
|
||||
@@ -629,7 +629,7 @@ xsltAttrTemplateProcess(xsltTransformContextPtr ctxt, xmlNodePtr target,
|
||||
* attributes will be disattached.)
|
||||
*/
|
||||
xmlAttrPtr
|
||||
xsltAttrListTemplateProcess(xsltTransformContextPtr ctxt,
|
||||
xsltAttrListTemplateProcess(xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr target, xmlAttrPtr attrs)
|
||||
{
|
||||
xmlAttrPtr attr, copy, last;
|
||||
@@ -643,7 +643,7 @@ xsltAttrListTemplateProcess(xsltTransformContextPtr ctxt,
|
||||
return(NULL);
|
||||
|
||||
oldInsert = ctxt->insert;
|
||||
ctxt->insert = target;
|
||||
ctxt->insert = target;
|
||||
|
||||
/*
|
||||
* Instantiate LRE-attributes.
|
||||
@@ -836,7 +836,7 @@ xmlNodePtr *
|
||||
xsltTemplateProcess(xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED, xmlNodePtr node) {
|
||||
if (node == NULL)
|
||||
return(NULL);
|
||||
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
@@ -20,21 +20,21 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltEvalXPathPredicate (xsltTransformContextPtr ctxt,
|
||||
xmlXPathCompExprPtr comp,
|
||||
xmlNsPtr *nsList,
|
||||
int nsNr);
|
||||
XSLTPUBFUN xmlChar * XSLTCALL
|
||||
XSLTPUBFUN xmlChar * XSLTCALL
|
||||
xsltEvalTemplateString (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr contextNode,
|
||||
xmlNodePtr inst);
|
||||
XSLTPUBFUN xmlChar * XSLTCALL
|
||||
XSLTPUBFUN xmlChar * XSLTCALL
|
||||
xsltEvalAttrValueTemplate (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr node,
|
||||
const xmlChar *name,
|
||||
const xmlChar *ns);
|
||||
XSLTPUBFUN const xmlChar * XSLTCALL
|
||||
XSLTPUBFUN const xmlChar * XSLTCALL
|
||||
xsltEvalStaticAttrValueTemplate (xsltStylesheetPtr style,
|
||||
xmlNodePtr node,
|
||||
const xmlChar *name,
|
||||
@@ -42,30 +42,30 @@ XSLTPUBFUN const xmlChar * XSLTCALL
|
||||
int *found);
|
||||
|
||||
/* TODO: this is obviously broken ... the namespaces should be passed too ! */
|
||||
XSLTPUBFUN xmlChar * XSLTCALL
|
||||
XSLTPUBFUN xmlChar * XSLTCALL
|
||||
xsltEvalXPathString (xsltTransformContextPtr ctxt,
|
||||
xmlXPathCompExprPtr comp);
|
||||
XSLTPUBFUN xmlChar * XSLTCALL
|
||||
XSLTPUBFUN xmlChar * XSLTCALL
|
||||
xsltEvalXPathStringNs (xsltTransformContextPtr ctxt,
|
||||
xmlXPathCompExprPtr comp,
|
||||
int nsNr,
|
||||
xmlNsPtr *nsList);
|
||||
|
||||
XSLTPUBFUN xmlNodePtr * XSLTCALL
|
||||
XSLTPUBFUN xmlNodePtr * XSLTCALL
|
||||
xsltTemplateProcess (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr node);
|
||||
XSLTPUBFUN xmlAttrPtr XSLTCALL
|
||||
XSLTPUBFUN xmlAttrPtr XSLTCALL
|
||||
xsltAttrListTemplateProcess (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr target,
|
||||
xmlAttrPtr cur);
|
||||
XSLTPUBFUN xmlAttrPtr XSLTCALL
|
||||
XSLTPUBFUN xmlAttrPtr XSLTCALL
|
||||
xsltAttrTemplateProcess (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr target,
|
||||
xmlAttrPtr attr);
|
||||
XSLTPUBFUN xmlChar * XSLTCALL
|
||||
XSLTPUBFUN xmlChar * XSLTCALL
|
||||
xsltAttrTemplateValueProcess (xsltTransformContextPtr ctxt,
|
||||
const xmlChar* attr);
|
||||
XSLTPUBFUN xmlChar * XSLTCALL
|
||||
XSLTPUBFUN xmlChar * XSLTCALL
|
||||
xsltAttrTemplateValueProcessNode(xsltTransformContextPtr ctxt,
|
||||
const xmlChar* str,
|
||||
xmlNodePtr node);
|
||||
|
@@ -294,7 +294,7 @@ static void
|
||||
profCallgraphAdd(xsltTemplatePtr templ, xsltTemplatePtr parent)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
if (templ->templMax == 0) {
|
||||
templ->templMax = 4;
|
||||
templ->templCalledTab =
|
||||
|
@@ -57,7 +57,7 @@ const xmlChar *xsltComputingGlobalVarMarker =
|
||||
* @ctxt: an XSLT transformation context
|
||||
*
|
||||
* Creates a Result Value Tree
|
||||
* (the XSLT 1.0 term for this is "Result Tree Fragment")
|
||||
* (the XSLT 1.0 term for this is "Result Tree Fragment")
|
||||
*
|
||||
* Returns the result value tree or NULL in case of API or internal errors.
|
||||
*/
|
||||
@@ -69,7 +69,7 @@ xsltCreateRVT(xsltTransformContextPtr ctxt)
|
||||
/*
|
||||
* Question: Why is this function public?
|
||||
* Answer: It is called by the EXSLT module.
|
||||
*/
|
||||
*/
|
||||
if (ctxt == NULL)
|
||||
return(NULL);
|
||||
|
||||
@@ -158,7 +158,7 @@ xsltRegisterLocalRVT(xsltTransformContextPtr ctxt,
|
||||
{
|
||||
if ((ctxt == NULL) || (RVT == NULL))
|
||||
return(-1);
|
||||
|
||||
|
||||
/*
|
||||
* When evaluating "select" expressions of xsl:variable
|
||||
* and xsl:param, we need to bind newly created tree fragments
|
||||
@@ -272,7 +272,7 @@ xsltExtensionInstructionResultRegister(xsltTransformContextPtr ctxt,
|
||||
(((xmlNsPtr) cur)->next->type == XML_ELEMENT_NODE))
|
||||
{
|
||||
cur = (xmlNodePtr) ((xmlNsPtr) cur)->next;
|
||||
doc = cur->doc;
|
||||
doc = cur->doc;
|
||||
} else {
|
||||
xsltTransformError(ctxt, NULL, ctxt->inst,
|
||||
"Internal error in "
|
||||
@@ -333,7 +333,7 @@ xsltReleaseRVT(xsltTransformContextPtr ctxt, xmlDocPtr RVT)
|
||||
}
|
||||
/*
|
||||
* Clear the document tree.
|
||||
* REVISIT TODO: Do we expect ID/IDREF tables to be existent?
|
||||
* REVISIT TODO: Do we expect ID/IDREF tables to be existent?
|
||||
*/
|
||||
if (RVT->children != NULL) {
|
||||
xmlFreeNodeList(RVT->children);
|
||||
@@ -522,7 +522,7 @@ xsltCopyStackElem(xsltStackElemPtr elem) {
|
||||
cur->nameURI = elem->nameURI;
|
||||
cur->select = elem->select;
|
||||
cur->tree = elem->tree;
|
||||
cur->comp = elem->comp;
|
||||
cur->comp = elem->comp;
|
||||
return(cur);
|
||||
}
|
||||
|
||||
@@ -563,13 +563,13 @@ xsltFreeStackElem(xsltStackElemPtr elem) {
|
||||
* </xsl:variable>
|
||||
* <f:result select="$bar"/>
|
||||
* </f:function>
|
||||
*
|
||||
*
|
||||
*/
|
||||
xsltRegisterLocalRVT(elem->context, cur);
|
||||
} else {
|
||||
xsltReleaseRVT((xsltTransformContextPtr) elem->context,
|
||||
cur);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
@@ -583,7 +583,7 @@ xsltFreeStackElem(xsltStackElemPtr elem) {
|
||||
memset(elem, 0, sizeof(xsltStackElem));
|
||||
elem->context = ctxt;
|
||||
elem->next = ctxt->cache->stackItems;
|
||||
ctxt->cache->stackItems = elem;
|
||||
ctxt->cache->stackItems = elem;
|
||||
ctxt->cache->nbStackItems++;
|
||||
#ifdef XSLT_DEBUG_PROFILE_CACHE
|
||||
ctxt->cache->dbgCachedVars++;
|
||||
@@ -602,7 +602,7 @@ xsltFreeStackElem(xsltStackElemPtr elem) {
|
||||
void
|
||||
xsltFreeStackElemList(xsltStackElemPtr elem) {
|
||||
xsltStackElemPtr next;
|
||||
|
||||
|
||||
while (elem != NULL) {
|
||||
next = elem->next;
|
||||
xsltFreeStackElem(elem);
|
||||
@@ -709,7 +709,7 @@ xsltCheckStackElem(xsltTransformContextPtr ctxt, const xmlChar *name,
|
||||
else if (cur->comp->type == XSLT_FUNC_PARAM)
|
||||
return(2);
|
||||
}
|
||||
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
@@ -757,10 +757,10 @@ xsltAddStackElem(xsltTransformContextPtr ctxt, xsltStackElemPtr elem)
|
||||
}
|
||||
ctxt->varsTab[ctxt->varsNr++] = elem;
|
||||
ctxt->vars = elem;
|
||||
|
||||
|
||||
elem = elem->next;
|
||||
} while (elem != NULL);
|
||||
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -804,7 +804,7 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
|
||||
(xsltStyleItemVariablePtr) castedComp;
|
||||
#else
|
||||
xsltStylePreCompPtr comp = castedComp;
|
||||
#endif
|
||||
#endif
|
||||
xmlXPathObjectPtr result = NULL;
|
||||
xmlNodePtr oldInst;
|
||||
|
||||
@@ -847,7 +847,7 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
|
||||
oldXPContextSize = xpctxt->contextSize;
|
||||
oldXPNamespaces = xpctxt->namespaces;
|
||||
oldXPNsNr = xpctxt->nsNr;
|
||||
|
||||
|
||||
xpctxt->node = ctxt->node;
|
||||
/*
|
||||
* OPTIMIZE TODO: Lame try to set the context doc.
|
||||
@@ -859,7 +859,7 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
|
||||
/*
|
||||
* BUG TODO: The proximity position and the context size will
|
||||
* potentially be wrong.
|
||||
* Example:
|
||||
* Example:
|
||||
* <xsl:template select="foo">
|
||||
* <xsl:variable name="pos" select="position()"/>
|
||||
* <xsl:for-each select="bar">
|
||||
@@ -870,9 +870,9 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
|
||||
* to the context of <xsl:for-each select="bar">, but
|
||||
* the variable needs to be evaluated in the context of
|
||||
* <xsl:template select="foo">.
|
||||
*/
|
||||
*/
|
||||
if (comp != NULL) {
|
||||
|
||||
|
||||
#ifdef XSLT_REFACTORED
|
||||
if (comp->inScopeNs != NULL) {
|
||||
xpctxt->namespaces = comp->inScopeNs->list;
|
||||
@@ -897,9 +897,9 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
|
||||
* we'll eventually free still referenced fragments, before
|
||||
* we leave the scope of the variable.
|
||||
*/
|
||||
ctxt->contextVariable = variable;
|
||||
variable->flags |= XSLT_VAR_IN_SELECT;
|
||||
|
||||
ctxt->contextVariable = variable;
|
||||
variable->flags |= XSLT_VAR_IN_SELECT;
|
||||
|
||||
result = xmlXPathCompiledEval(xpExpr, xpctxt);
|
||||
|
||||
variable->flags ^= XSLT_VAR_IN_SELECT;
|
||||
@@ -937,7 +937,7 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
|
||||
} else {
|
||||
if (variable->tree == NULL) {
|
||||
result = xmlXPathNewCString("");
|
||||
} else {
|
||||
} else {
|
||||
if (variable->tree) {
|
||||
xmlDocPtr container;
|
||||
xmlNodePtr oldInsert;
|
||||
@@ -959,14 +959,14 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
|
||||
*/
|
||||
/*
|
||||
* Attach the Result Tree Fragment to the variable;
|
||||
* when the variable is freed, it will also free
|
||||
* when the variable is freed, it will also free
|
||||
* the Result Tree Fragment.
|
||||
*/
|
||||
variable->fragment = container;
|
||||
|
||||
|
||||
oldOutput = ctxt->output;
|
||||
oldInsert = ctxt->insert;
|
||||
|
||||
oldInsert = ctxt->insert;
|
||||
|
||||
ctxt->output = container;
|
||||
ctxt->insert = (xmlNodePtr) container;
|
||||
ctxt->contextVariable = variable;
|
||||
@@ -977,10 +977,10 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
|
||||
xsltApplyOneTemplate(ctxt, ctxt->node, variable->tree,
|
||||
NULL, NULL);
|
||||
|
||||
ctxt->contextVariable = oldVar;
|
||||
ctxt->contextVariable = oldVar;
|
||||
ctxt->insert = oldInsert;
|
||||
ctxt->output = oldOutput;
|
||||
|
||||
|
||||
result = xmlXPathNewValueTree((xmlNodePtr) container);
|
||||
}
|
||||
if (result == NULL) {
|
||||
@@ -990,7 +990,7 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
|
||||
* Freeing is not handled there anymore.
|
||||
* QUESTION TODO: What does the above comment mean?
|
||||
*/
|
||||
result->boolval = 0;
|
||||
result->boolval = 0;
|
||||
}
|
||||
#ifdef WITH_XSLT_DEBUG_VARIABLE
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
@@ -1063,7 +1063,7 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
|
||||
* called; and in the case of global params, if values for such params
|
||||
* are provided by the user.
|
||||
*/
|
||||
if (elem->select != NULL) {
|
||||
if (elem->select != NULL) {
|
||||
xmlXPathCompExprPtr xpExpr = NULL;
|
||||
xmlDocPtr oldXPDoc;
|
||||
xmlNodePtr oldXPContextNode;
|
||||
@@ -1078,8 +1078,8 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
|
||||
}
|
||||
if (xpExpr == NULL)
|
||||
goto error;
|
||||
|
||||
|
||||
|
||||
|
||||
if (comp != NULL)
|
||||
ctxt->inst = comp->inst;
|
||||
else
|
||||
@@ -1091,7 +1091,7 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
|
||||
* to process the root node of the source document: the current
|
||||
* node is the root node of the source document and the current
|
||||
* node list is a list containing just the root node of the source
|
||||
* document."
|
||||
* document."
|
||||
*/
|
||||
/*
|
||||
* Save context states.
|
||||
@@ -1102,14 +1102,14 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
|
||||
oldXPContextSize = xpctxt->contextSize;
|
||||
oldXPNamespaces = xpctxt->namespaces;
|
||||
oldXPNsNr = xpctxt->nsNr;
|
||||
|
||||
|
||||
xpctxt->node = ctxt->initialContextNode;
|
||||
xpctxt->doc = ctxt->initialContextDoc;
|
||||
xpctxt->contextSize = 1;
|
||||
xpctxt->proximityPosition = 1;
|
||||
|
||||
|
||||
if (comp != NULL) {
|
||||
|
||||
|
||||
#ifdef XSLT_REFACTORED
|
||||
if (comp->inScopeNs != NULL) {
|
||||
xpctxt->namespaces = comp->inScopeNs->list;
|
||||
@@ -1126,7 +1126,7 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
|
||||
xpctxt->namespaces = NULL;
|
||||
xpctxt->nsNr = 0;
|
||||
}
|
||||
|
||||
|
||||
result = xmlXPathCompiledEval(xpExpr, xpctxt);
|
||||
|
||||
/*
|
||||
@@ -1165,7 +1165,7 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
|
||||
} else {
|
||||
xmlDocPtr container;
|
||||
xmlNodePtr oldInsert;
|
||||
xmlDocPtr oldOutput, oldXPDoc;
|
||||
xmlDocPtr oldOutput, oldXPDoc;
|
||||
/*
|
||||
* Generate a result tree fragment.
|
||||
*/
|
||||
@@ -1176,14 +1176,14 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
|
||||
* Let the lifetime of the tree fragment be handled by
|
||||
* the Libxslt's garbage collector.
|
||||
*/
|
||||
xsltRegisterPersistRVT(ctxt, container);
|
||||
xsltRegisterPersistRVT(ctxt, container);
|
||||
|
||||
oldOutput = ctxt->output;
|
||||
oldInsert = ctxt->insert;
|
||||
|
||||
oldXPDoc = ctxt->xpathCtxt->doc;
|
||||
|
||||
ctxt->output = container;
|
||||
|
||||
ctxt->output = container;
|
||||
ctxt->insert = (xmlNodePtr) container;
|
||||
|
||||
ctxt->xpathCtxt->doc = ctxt->initialContextDoc;
|
||||
@@ -1196,7 +1196,7 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
|
||||
|
||||
ctxt->insert = oldInsert;
|
||||
ctxt->output = oldOutput;
|
||||
|
||||
|
||||
result = xmlXPathNewValueTree((xmlNodePtr) container);
|
||||
if (result == NULL) {
|
||||
result = xmlXPathNewCString("");
|
||||
@@ -1236,11 +1236,11 @@ error:
|
||||
int
|
||||
xsltEvalGlobalVariables(xsltTransformContextPtr ctxt) {
|
||||
xsltStackElemPtr elem;
|
||||
xsltStylesheetPtr style;
|
||||
xsltStylesheetPtr style;
|
||||
|
||||
if ((ctxt == NULL) || (ctxt->document == NULL))
|
||||
return(-1);
|
||||
|
||||
|
||||
#ifdef WITH_XSLT_DEBUG_VARIABLE
|
||||
XSLT_TRACE(ctxt,XSLT_TRACE_VARIABLES,xsltGenericDebug(xsltGenericDebugContext,
|
||||
"Registering global variables\n"));
|
||||
@@ -1251,7 +1251,7 @@ xsltEvalGlobalVariables(xsltTransformContextPtr ctxt) {
|
||||
style = ctxt->style;
|
||||
while (style != NULL) {
|
||||
elem = style->variables;
|
||||
|
||||
|
||||
#ifdef WITH_XSLT_DEBUG_VARIABLE
|
||||
if ((style->doc != NULL) && (style->doc->URL != NULL)) {
|
||||
XSLT_TRACE(ctxt,XSLT_TRACE_VARIABLES,xsltGenericDebug(xsltGenericDebugContext,
|
||||
@@ -1266,7 +1266,7 @@ xsltEvalGlobalVariables(xsltTransformContextPtr ctxt) {
|
||||
/*
|
||||
* Global variables are stored in the variables pool.
|
||||
*/
|
||||
def = (xsltStackElemPtr)
|
||||
def = (xsltStackElemPtr)
|
||||
xmlHashLookup2(ctxt->globalVars,
|
||||
elem->name, elem->nameURI);
|
||||
if (def == NULL) {
|
||||
@@ -1297,7 +1297,7 @@ xsltEvalGlobalVariables(xsltTransformContextPtr ctxt) {
|
||||
|
||||
/*
|
||||
* This part does the actual evaluation
|
||||
*/
|
||||
*/
|
||||
xmlHashScan(ctxt->globalVars,
|
||||
(xmlHashScanner) xsltEvalGlobalVariable, ctxt);
|
||||
|
||||
@@ -1423,7 +1423,7 @@ xsltProcessUserParamInternal(xsltTransformContextPtr ctxt,
|
||||
const xmlChar *href;
|
||||
xmlXPathCompExprPtr xpExpr;
|
||||
xmlXPathObjectPtr result;
|
||||
|
||||
|
||||
xsltStackElemPtr elem;
|
||||
int res;
|
||||
void *res_ptr;
|
||||
@@ -1505,7 +1505,7 @@ xsltProcessUserParamInternal(xsltTransformContextPtr ctxt,
|
||||
int oldXPProximityPosition, oldXPContextSize, oldXPNsNr;
|
||||
xmlNsPtr *oldXPNamespaces;
|
||||
xmlXPathContextPtr xpctxt = ctxt->xpathCtxt;
|
||||
|
||||
|
||||
/*
|
||||
* Save context states.
|
||||
*/
|
||||
@@ -1525,19 +1525,19 @@ xsltProcessUserParamInternal(xsltTransformContextPtr ctxt,
|
||||
* node list is a list containing just the root node of the source
|
||||
* document."
|
||||
*/
|
||||
xpctxt->doc = ctxt->initialContextDoc;
|
||||
xpctxt->node = ctxt->initialContextNode;
|
||||
xpctxt->doc = ctxt->initialContextDoc;
|
||||
xpctxt->node = ctxt->initialContextNode;
|
||||
xpctxt->contextSize = 1;
|
||||
xpctxt->proximityPosition = 1;
|
||||
/*
|
||||
/*
|
||||
* There is really no in scope namespace for parameters on the
|
||||
* command line.
|
||||
*/
|
||||
xpctxt->namespaces = NULL;
|
||||
xpctxt->nsNr = 0;
|
||||
|
||||
xpctxt->nsNr = 0;
|
||||
|
||||
result = xmlXPathCompiledEval(xpExpr, xpctxt);
|
||||
|
||||
|
||||
/*
|
||||
* Restore Context states.
|
||||
*/
|
||||
@@ -1547,7 +1547,7 @@ xsltProcessUserParamInternal(xsltTransformContextPtr ctxt,
|
||||
xpctxt->proximityPosition = oldXPProximityPosition;
|
||||
xpctxt->namespaces = oldXPNamespaces;
|
||||
xpctxt->nsNr = oldXPNsNr;
|
||||
|
||||
|
||||
xmlXPathFreeCompExpr(xpExpr);
|
||||
}
|
||||
if (result == NULL) {
|
||||
@@ -1558,9 +1558,9 @@ xsltProcessUserParamInternal(xsltTransformContextPtr ctxt,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* If @eval is 0 then @value is to be taken literally and result is NULL
|
||||
*
|
||||
*
|
||||
* If @eval is not 0, then @value is an XPath expression and has been
|
||||
* successfully evaluated and result contains the resulting value and
|
||||
* is not NULL.
|
||||
@@ -1588,7 +1588,7 @@ xsltProcessUserParamInternal(xsltTransformContextPtr ctxt,
|
||||
elem->computed = 1;
|
||||
if (eval == 0) {
|
||||
elem->value = xmlXPathNewString(value);
|
||||
}
|
||||
}
|
||||
else {
|
||||
elem->value = result;
|
||||
}
|
||||
@@ -1621,7 +1621,7 @@ xsltProcessUserParamInternal(xsltTransformContextPtr ctxt,
|
||||
*
|
||||
* Returns 0 in case of success, -1 in case of error
|
||||
*/
|
||||
|
||||
|
||||
int
|
||||
xsltEvalUserParams(xsltTransformContextPtr ctxt, const char **params) {
|
||||
int indx = 0;
|
||||
@@ -1633,7 +1633,7 @@ xsltEvalUserParams(xsltTransformContextPtr ctxt, const char **params) {
|
||||
while (params[indx] != NULL) {
|
||||
name = (const xmlChar *) params[indx++];
|
||||
value = (const xmlChar *) params[indx++];
|
||||
if (xsltEvalOneUserParam(ctxt, name, value) != 0)
|
||||
if (xsltEvalOneUserParam(ctxt, name, value) != 0)
|
||||
return(-1);
|
||||
}
|
||||
return 0;
|
||||
@@ -1651,7 +1651,7 @@ xsltEvalUserParams(xsltTransformContextPtr ctxt, const char **params) {
|
||||
*
|
||||
* Returns 0 in case of success, -1 in case of error.
|
||||
*/
|
||||
|
||||
|
||||
int
|
||||
xsltQuoteUserParams(xsltTransformContextPtr ctxt, const char **params) {
|
||||
int indx = 0;
|
||||
@@ -1663,7 +1663,7 @@ xsltQuoteUserParams(xsltTransformContextPtr ctxt, const char **params) {
|
||||
while (params[indx] != NULL) {
|
||||
name = (const xmlChar *) params[indx++];
|
||||
value = (const xmlChar *) params[indx++];
|
||||
if (xsltQuoteOneUserParam(ctxt, name, value) != 0)
|
||||
if (xsltQuoteOneUserParam(ctxt, name, value) != 0)
|
||||
return(-1);
|
||||
}
|
||||
return 0;
|
||||
@@ -1689,7 +1689,7 @@ xsltQuoteUserParams(xsltTransformContextPtr ctxt, const char **params) {
|
||||
|
||||
int
|
||||
xsltEvalOneUserParam(xsltTransformContextPtr ctxt,
|
||||
const xmlChar * name,
|
||||
const xmlChar * name,
|
||||
const xmlChar * value) {
|
||||
return xsltProcessUserParamInternal(ctxt, name, value,
|
||||
1 /* xpath eval ? */);
|
||||
@@ -1736,7 +1736,7 @@ xsltBuildVariable(xsltTransformContextPtr ctxt,
|
||||
(xsltStyleBasicItemVariablePtr) castedComp;
|
||||
#else
|
||||
xsltStylePreCompPtr comp = castedComp;
|
||||
#endif
|
||||
#endif
|
||||
xsltStackElemPtr elem;
|
||||
|
||||
#ifdef WITH_XSLT_DEBUG_VARIABLE
|
||||
@@ -1786,8 +1786,8 @@ xsltRegisterVariable(xsltTransformContextPtr ctxt,
|
||||
xsltStylePreCompPtr comp = castedComp;
|
||||
int present;
|
||||
#endif
|
||||
xsltStackElemPtr variable;
|
||||
|
||||
xsltStackElemPtr variable;
|
||||
|
||||
#ifdef XSLT_REFACTORED
|
||||
/*
|
||||
* REFACTORED NOTE: Redefinitions of vars/params are checked
|
||||
@@ -1796,7 +1796,7 @@ xsltRegisterVariable(xsltTransformContextPtr ctxt,
|
||||
*/
|
||||
#else
|
||||
present = xsltCheckStackElem(ctxt, comp->name, comp->ns);
|
||||
if (isParam == 0) {
|
||||
if (isParam == 0) {
|
||||
if ((present != 0) && (present != 3)) {
|
||||
/* TODO: report QName. */
|
||||
xsltTransformError(ctxt, NULL, comp->inst,
|
||||
@@ -1912,13 +1912,13 @@ xsltVariableLookup(xsltTransformContextPtr ctxt, const xmlChar *name,
|
||||
|
||||
/**
|
||||
* xsltParseStylesheetCallerParam:
|
||||
* @ctxt: the XSLT transformation context
|
||||
* @ctxt: the XSLT transformation context
|
||||
* @inst: the xsl:with-param instruction element
|
||||
*
|
||||
* Processes an xsl:with-param instruction at transformation time.
|
||||
* The value is compute, but not recorded.
|
||||
* NOTE that this is also called with an *xsl:param* element
|
||||
* from exsltFuncFunctionFunction().
|
||||
* from exsltFuncFunctionFunction().
|
||||
*
|
||||
* Returns the new xsltStackElemPtr or NULL
|
||||
*/
|
||||
@@ -1934,7 +1934,7 @@ xsltParseStylesheetCallerParam(xsltTransformContextPtr ctxt, xmlNodePtr inst)
|
||||
xmlNodePtr tree = NULL; /* The first child node of the instruction or
|
||||
the instruction itself. */
|
||||
xsltStackElemPtr param = NULL;
|
||||
|
||||
|
||||
if ((ctxt == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
|
||||
return(NULL);
|
||||
|
||||
@@ -1943,7 +1943,7 @@ xsltParseStylesheetCallerParam(xsltTransformContextPtr ctxt, xmlNodePtr inst)
|
||||
#else
|
||||
comp = (xsltStylePreCompPtr) inst->psvi;
|
||||
#endif
|
||||
|
||||
|
||||
if (comp == NULL) {
|
||||
xsltTransformError(ctxt, NULL, inst,
|
||||
"Internal error in xsltParseStylesheetCallerParam(): "
|
||||
@@ -1996,7 +1996,7 @@ xsltParseGlobalVariable(xsltStylesheetPtr style, xmlNodePtr cur)
|
||||
|
||||
if ((cur == NULL) || (style == NULL) || (cur->type != XML_ELEMENT_NODE))
|
||||
return;
|
||||
|
||||
|
||||
#ifdef XSLT_REFACTORED
|
||||
/*
|
||||
* Note that xsltStylePreCompute() will be called from
|
||||
@@ -2023,7 +2023,7 @@ xsltParseGlobalVariable(xsltStylesheetPtr style, xmlNodePtr cur)
|
||||
* Parse the content (a sequence constructor) of xsl:variable.
|
||||
*/
|
||||
if (cur->children != NULL) {
|
||||
#ifdef XSLT_REFACTORED
|
||||
#ifdef XSLT_REFACTORED
|
||||
xsltParseSequenceConstructor(XSLT_CCTXT(style), cur->children);
|
||||
#else
|
||||
xsltParseTemplateContent(style, cur);
|
||||
@@ -2058,7 +2058,7 @@ xsltParseGlobalParam(xsltStylesheetPtr style, xmlNodePtr cur) {
|
||||
|
||||
if ((cur == NULL) || (style == NULL) || (cur->type != XML_ELEMENT_NODE))
|
||||
return;
|
||||
|
||||
|
||||
#ifdef XSLT_REFACTORED
|
||||
/*
|
||||
* Note that xsltStylePreCompute() will be called from
|
||||
@@ -2068,7 +2068,7 @@ xsltParseGlobalParam(xsltStylesheetPtr style, xmlNodePtr cur) {
|
||||
#else
|
||||
xsltStylePreCompute(style, cur);
|
||||
comp = (xsltStylePreCompPtr) cur->psvi;
|
||||
#endif
|
||||
#endif
|
||||
if (comp == NULL) {
|
||||
xsltTransformError(NULL, style, cur,
|
||||
"xsl:param : compilation failed\n");
|
||||
@@ -2085,7 +2085,7 @@ xsltParseGlobalParam(xsltStylesheetPtr style, xmlNodePtr cur) {
|
||||
* Parse the content (a sequence constructor) of xsl:param.
|
||||
*/
|
||||
if (cur->children != NULL) {
|
||||
#ifdef XSLT_REFACTORED
|
||||
#ifdef XSLT_REFACTORED
|
||||
xsltParseSequenceConstructor(XSLT_CCTXT(style), cur->children);
|
||||
#else
|
||||
xsltParseTemplateContent(style, cur);
|
||||
@@ -2217,7 +2217,7 @@ xsltXPathVariableLookup(void *ctxt, const xmlChar *name,
|
||||
XSLT_TRACE(((xsltTransformContextPtr)ctxt),XSLT_TRACE_VARIABLES,xsltGenericDebug(xsltGenericDebugContext,
|
||||
"Lookup variable '%s'\n", name));
|
||||
#endif
|
||||
|
||||
|
||||
tctxt = (xsltTransformContextPtr) ctxt;
|
||||
/*
|
||||
* Local variables/params ---------------------------------------------
|
||||
@@ -2241,7 +2241,7 @@ xsltXPathVariableLookup(void *ctxt, const xmlChar *name,
|
||||
goto local_variable_found;
|
||||
}
|
||||
cur = cur->next;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Redo the lookup with interned strings to avoid string comparison.
|
||||
*
|
||||
@@ -2254,7 +2254,7 @@ xsltXPathVariableLookup(void *ctxt, const xmlChar *name,
|
||||
name = xmlDictLookup(tctxt->dict, name, -1);
|
||||
if (ns_uri)
|
||||
ns_uri = xmlDictLookup(tctxt->dict, ns_uri, -1);
|
||||
if ((tmpName != name) || (tmpNsName != ns_uri)) {
|
||||
if ((tmpName != name) || (tmpNsName != ns_uri)) {
|
||||
for (i = tctxt->varsNr; i > tctxt->varsBase; i--) {
|
||||
cur = tctxt->varsTab[i-1];
|
||||
if ((cur->name == name) && (cur->nameURI == ns_uri)) {
|
||||
@@ -2272,7 +2272,7 @@ local_variable_found:
|
||||
|
||||
if (variable) {
|
||||
if (variable->computed == 0) {
|
||||
|
||||
|
||||
#ifdef WITH_XSLT_DEBUG_VARIABLE
|
||||
XSLT_TRACE(tctxt,XSLT_TRACE_VARIABLES,xsltGenericDebug(xsltGenericDebugContext,
|
||||
"uncomputed variable '%s'\n", name));
|
||||
@@ -2281,14 +2281,14 @@ local_variable_found:
|
||||
variable->computed = 1;
|
||||
}
|
||||
if (variable->value != NULL) {
|
||||
valueObj = xmlXPathObjectCopy(variable->value);
|
||||
valueObj = xmlXPathObjectCopy(variable->value);
|
||||
}
|
||||
return(valueObj);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Global variables/params --------------------------------------------
|
||||
*/
|
||||
*/
|
||||
if (tctxt->globalVars) {
|
||||
valueObj = xsltGlobalVariableLookup(tctxt, name, ns_uri);
|
||||
}
|
||||
|
@@ -38,48 +38,48 @@ extern "C" {
|
||||
* Interfaces for the variable module.
|
||||
*/
|
||||
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltEvalGlobalVariables (xsltTransformContextPtr ctxt);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltEvalUserParams (xsltTransformContextPtr ctxt,
|
||||
const char **params);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltQuoteUserParams (xsltTransformContextPtr ctxt,
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltQuoteUserParams (xsltTransformContextPtr ctxt,
|
||||
const char **params);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltEvalOneUserParam (xsltTransformContextPtr ctxt,
|
||||
const xmlChar * name,
|
||||
const xmlChar * name,
|
||||
const xmlChar * value);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltQuoteOneUserParam (xsltTransformContextPtr ctxt,
|
||||
const xmlChar * name,
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltQuoteOneUserParam (xsltTransformContextPtr ctxt,
|
||||
const xmlChar * name,
|
||||
const xmlChar * value);
|
||||
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltParseGlobalVariable (xsltStylesheetPtr style,
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltParseGlobalVariable (xsltStylesheetPtr style,
|
||||
xmlNodePtr cur);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltParseGlobalParam (xsltStylesheetPtr style,
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltParseGlobalParam (xsltStylesheetPtr style,
|
||||
xmlNodePtr cur);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltParseStylesheetVariable (xsltTransformContextPtr ctxt,
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltParseStylesheetVariable (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltParseStylesheetParam (xsltTransformContextPtr ctxt,
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltParseStylesheetParam (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XSLTPUBFUN xsltStackElemPtr XSLTCALL
|
||||
XSLTPUBFUN xsltStackElemPtr XSLTCALL
|
||||
xsltParseStylesheetCallerParam (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltAddStackElemList (xsltTransformContextPtr ctxt,
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltAddStackElemList (xsltTransformContextPtr ctxt,
|
||||
xsltStackElemPtr elems);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeGlobalVariables (xsltTransformContextPtr ctxt);
|
||||
XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeGlobalVariables (xsltTransformContextPtr ctxt);
|
||||
XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
|
||||
xsltVariableLookup (xsltTransformContextPtr ctxt,
|
||||
const xmlChar *name,
|
||||
const xmlChar *ns_uri);
|
||||
XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
|
||||
XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
|
||||
xsltXPathVariableLookup (void *ctxt,
|
||||
const xmlChar *name,
|
||||
const xmlChar *ns_uri);
|
||||
|
@@ -28,12 +28,12 @@
|
||||
#include <math.h>
|
||||
#if defined _MSC_VER || defined __MINGW32__
|
||||
/* MS C-runtime has functions which can be used in order to determine if
|
||||
a given floating-point variable contains NaN, (+-)INF. These are
|
||||
a given floating-point variable contains NaN, (+-)INF. These are
|
||||
preferred, because floating-point technology is considered propriatary
|
||||
by MS and we can assume that their functions know more about their
|
||||
by MS and we can assume that their functions know more about their
|
||||
oddities than we do. */
|
||||
#include <float.h>
|
||||
/* Bjorn Reese figured a quite nice construct for isinf() using the
|
||||
/* Bjorn Reese figured a quite nice construct for isinf() using the
|
||||
_fpclass() function. */
|
||||
#ifndef isinf
|
||||
#define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \
|
||||
|
536
libxslt/xslt.c
536
libxslt/xslt.c
File diff suppressed because it is too large
Load Diff
@@ -99,7 +99,7 @@ XSLTPUBFUN void XSLTCALL
|
||||
/*
|
||||
* Global cleanup function.
|
||||
*/
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltCleanupGlobals (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Summary: internal data structures, constants and functions
|
||||
* Description: Internal data structures, constants and functions used
|
||||
* by the XSLT engine.
|
||||
* by the XSLT engine.
|
||||
* They are not part of the API or ABI, i.e. they can change
|
||||
* without prior notice, use carefully.
|
||||
*
|
||||
@@ -101,7 +101,7 @@ extern const xmlChar *xsltXSLTAttrMarker;
|
||||
* XSLT_REFACTORED_XSLT_NSCOMP
|
||||
*
|
||||
* Internal define to enable the pointer-comparison of
|
||||
* namespaces of XSLT elements.
|
||||
* namespaces of XSLT elements.
|
||||
*/
|
||||
/* #define XSLT_REFACTORED_XSLT_NSCOMP */
|
||||
|
||||
@@ -294,7 +294,7 @@ struct _xsltTemplate {
|
||||
int nbCalls; /* the number of time the template was called */
|
||||
unsigned long time; /* the time spent in this template */
|
||||
void *params; /* xsl:param instructions */
|
||||
|
||||
|
||||
int templNr; /* Nb of templates in the stack */
|
||||
int templMax; /* Size of the templtes stack */
|
||||
xsltTemplatePtr *templCalledTab; /* templates called */
|
||||
@@ -479,7 +479,7 @@ struct _xsltElemPreComp {
|
||||
xsltElemPreCompPtr next; /* next item in the global chained
|
||||
list hold by xsltStylesheet. */
|
||||
xsltStyleType type; /* type of the element */
|
||||
xsltTransformFunction func; /* handling function */
|
||||
xsltTransformFunction func; /* handling function */
|
||||
xmlNodePtr inst; /* the node in the stylesheet's tree
|
||||
corresponding to this item */
|
||||
|
||||
@@ -511,7 +511,7 @@ XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltPointerListClear (xsltPointerListPtr list);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltPointerListAddSize (xsltPointerListPtr list,
|
||||
xsltPointerListAddSize (xsltPointerListPtr list,
|
||||
void *item,
|
||||
int initialSize);
|
||||
|
||||
@@ -526,12 +526,12 @@ typedef xsltNsListContainer *xsltNsListContainerPtr;
|
||||
struct _xsltNsListContainer {
|
||||
xmlNsPtr *list;
|
||||
int totalNumber;
|
||||
int xpathNumber;
|
||||
int xpathNumber;
|
||||
};
|
||||
|
||||
/**
|
||||
* XSLT_ITEM_COMPATIBILITY_FIELDS:
|
||||
*
|
||||
*
|
||||
* Fields for API compatibility to the structure
|
||||
* _xsltElemPreComp which is used for extension functions.
|
||||
* Note that @next is used for storage; it does not reflect a next
|
||||
@@ -554,7 +554,7 @@ struct _xsltNsListContainer {
|
||||
/*
|
||||
xsltStylePreCompPtr parent;\
|
||||
xsltStylePreCompPtr children;\
|
||||
xsltStylePreCompPtr nextItem;
|
||||
xsltStylePreCompPtr nextItem;
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -575,7 +575,7 @@ struct _xsltNsListContainer {
|
||||
XSLT_ITEM_NSINSCOPE_FIELDS
|
||||
|
||||
/**
|
||||
* _xsltStylePreComp:
|
||||
* _xsltStylePreComp:
|
||||
*
|
||||
* The abstract basic structure for items of the XSLT processor.
|
||||
* This includes:
|
||||
@@ -590,7 +590,7 @@ struct _xsltNsListContainer {
|
||||
struct _xsltStylePreComp {
|
||||
xsltElemPreCompPtr next; /* next item in the global chained
|
||||
list hold by xsltStylesheet */
|
||||
xsltStyleType type; /* type of the item */
|
||||
xsltStyleType type; /* type of the item */
|
||||
xsltTransformFunction func; /* handling function */
|
||||
xmlNodePtr inst; /* the node in the stylesheet's tree
|
||||
corresponding to this item. */
|
||||
@@ -600,7 +600,7 @@ struct _xsltStylePreComp {
|
||||
|
||||
/**
|
||||
* xsltStyleBasicEmptyItem:
|
||||
*
|
||||
*
|
||||
* Abstract structure only used as a short-cut for
|
||||
* XSLT items with no extra fields.
|
||||
* NOTE that it is intended that this structure looks the same as
|
||||
@@ -615,7 +615,7 @@ struct _xsltStyleBasicEmptyItem {
|
||||
|
||||
/**
|
||||
* xsltStyleBasicExpressionItem:
|
||||
*
|
||||
*
|
||||
* Abstract structure only used as a short-cut for
|
||||
* XSLT items with just an expression.
|
||||
*/
|
||||
@@ -637,7 +637,7 @@ struct _xsltStyleBasicExpressionItem {
|
||||
|
||||
/**
|
||||
* xsltStyleItemElement:
|
||||
*
|
||||
*
|
||||
* <!-- Category: instruction -->
|
||||
* <xsl:element
|
||||
* name = { qname }
|
||||
@@ -650,11 +650,11 @@ typedef struct _xsltStyleItemElement xsltStyleItemElement;
|
||||
typedef xsltStyleItemElement *xsltStyleItemElementPtr;
|
||||
|
||||
struct _xsltStyleItemElement {
|
||||
XSLT_ITEM_COMMON_FIELDS
|
||||
XSLT_ITEM_COMMON_FIELDS
|
||||
|
||||
const xmlChar *use;
|
||||
int has_use;
|
||||
const xmlChar *name;
|
||||
const xmlChar *name;
|
||||
int has_name;
|
||||
const xmlChar *ns;
|
||||
const xmlChar *nsPrefix;
|
||||
@@ -799,7 +799,7 @@ typedef xsltStyleItemCopy *xsltStyleItemCopyPtr;
|
||||
struct _xsltStyleItemCopy {
|
||||
XSLT_ITEM_COMMON_FIELDS
|
||||
const xmlChar *use; /* copy, element */
|
||||
int has_use; /* copy, element */
|
||||
int has_use; /* copy, element */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -921,7 +921,7 @@ typedef struct _xsltStyleItemMessage xsltStyleItemMessage;
|
||||
typedef xsltStyleItemMessage *xsltStyleItemMessagePtr;
|
||||
|
||||
struct _xsltStyleItemMessage {
|
||||
XSLT_ITEM_COMMON_FIELDS
|
||||
XSLT_ITEM_COMMON_FIELDS
|
||||
int terminate;
|
||||
};
|
||||
|
||||
@@ -940,7 +940,7 @@ struct _xsltStyleItemDocument {
|
||||
TODO: Check if we need. */
|
||||
const xmlChar *filename; /* document URL */
|
||||
int has_filename;
|
||||
};
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
@@ -1010,7 +1010,7 @@ struct _xsltStyleItemParam {
|
||||
const xmlChar *name;
|
||||
int has_name;
|
||||
const xmlChar *ns;
|
||||
int has_ns;
|
||||
int has_ns;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1066,7 +1066,7 @@ struct _xsltStyleItemSort {
|
||||
|
||||
/**
|
||||
* xsltStyleItemWhen:
|
||||
*
|
||||
*
|
||||
* <xsl:when
|
||||
* test = boolean-expression>
|
||||
* <!-- Content: template -->
|
||||
@@ -1149,7 +1149,7 @@ typedef struct _xsltStyleItemExtElement xsltStyleItemExtElement;
|
||||
typedef xsltStyleItemExtElement *xsltStyleItemExtElementPtr;
|
||||
struct _xsltStyleItemExtElement {
|
||||
XSLT_ITEM_COMMON_FIELDS
|
||||
xsltElemPreCompPtr item;
|
||||
xsltElemPreCompPtr item;
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
@@ -1165,7 +1165,7 @@ struct _xsltEffectiveNs {
|
||||
xsltEffectiveNsPtr next; /* next item in the list */
|
||||
const xmlChar *prefix;
|
||||
const xmlChar *nsName;
|
||||
/*
|
||||
/*
|
||||
* Indicates if eclared on the literal result element; dunno if really
|
||||
* needed.
|
||||
*/
|
||||
@@ -1201,7 +1201,7 @@ struct _xsltStyleItemLRElementInfo {
|
||||
typedef struct _xsltNsAlias xsltNsAlias;
|
||||
typedef xsltNsAlias *xsltNsAliasPtr;
|
||||
struct _xsltNsAlias {
|
||||
xsltNsAliasPtr next; /* next in the list */
|
||||
xsltNsAliasPtr next; /* next in the list */
|
||||
xmlNsPtr literalNs;
|
||||
xmlNsPtr targetNs;
|
||||
xmlDocPtr docOfTargetNs;
|
||||
@@ -1218,7 +1218,7 @@ struct _xsltNsMap {
|
||||
xmlNodePtr elem; /* the element holding the ns-decl */
|
||||
xmlNsPtr ns; /* the xmlNs structure holding the XML namespace name */
|
||||
const xmlChar *origNsName; /* the original XML namespace name */
|
||||
const xmlChar *newNsName; /* the mapped XML namespace name */
|
||||
const xmlChar *newNsName; /* the mapped XML namespace name */
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -1273,13 +1273,13 @@ struct _xsltCompilerNodeInfo {
|
||||
/* The current in-scope namespaces */
|
||||
xsltNsListContainerPtr inScopeNs;
|
||||
/* The current excluded result namespaces */
|
||||
xsltPointerListPtr exclResultNs;
|
||||
xsltPointerListPtr exclResultNs;
|
||||
/* The current extension instruction namespaces */
|
||||
xsltPointerListPtr extElemNs;
|
||||
|
||||
/* The current info for literal result elements. */
|
||||
xsltStyleItemLRElementInfoPtr litResElemInfo;
|
||||
/*
|
||||
/*
|
||||
* Set to 1 if in-scope namespaces changed,
|
||||
* or excluded result namespaces changed,
|
||||
* or extension element namespaces changed.
|
||||
@@ -1294,7 +1294,7 @@ struct _xsltCompilerNodeInfo {
|
||||
/* whether the content of an extension element was processed */
|
||||
int extContentHandled;
|
||||
/* the type of the current child */
|
||||
xsltStyleType curChildType;
|
||||
xsltStyleType curChildType;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1302,7 +1302,7 @@ struct _xsltCompilerNodeInfo {
|
||||
*
|
||||
* get pointer to compiler context
|
||||
*/
|
||||
#define XSLT_CCTXT(style) ((xsltCompilerCtxtPtr) style->compCtxt)
|
||||
#define XSLT_CCTXT(style) ((xsltCompilerCtxtPtr) style->compCtxt)
|
||||
|
||||
typedef enum {
|
||||
XSLT_ERROR_SEVERITY_ERROR = 0,
|
||||
@@ -1315,7 +1315,7 @@ struct _xsltCompilerCtxt {
|
||||
void *errorCtxt; /* user specific error context */
|
||||
/*
|
||||
* used for error/warning reports; e.g. XSLT_ERROR_SEVERITY_WARNING */
|
||||
xsltErrorSeverityType errSeverity;
|
||||
xsltErrorSeverityType errSeverity;
|
||||
int warnings; /* TODO: number of warnings found at
|
||||
compilation */
|
||||
int errors; /* TODO: number of errors found at
|
||||
@@ -1325,7 +1325,7 @@ struct _xsltCompilerCtxt {
|
||||
int simplified; /* whether this is a simplified stylesheet */
|
||||
/* TODO: structured/unstructured error contexts. */
|
||||
int depth; /* Current depth of processing */
|
||||
|
||||
|
||||
xsltCompilerNodeInfoPtr inode;
|
||||
xsltCompilerNodeInfoPtr inodeList;
|
||||
xsltCompilerNodeInfoPtr inodeLast;
|
||||
@@ -1338,7 +1338,7 @@ struct _xsltCompilerCtxt {
|
||||
in a parsing episode */
|
||||
int maxNodeInfos; /* TEMP TODO: just for the interest */
|
||||
int maxLREs; /* TEMP TODO: just for the interest */
|
||||
/*
|
||||
/*
|
||||
* In order to keep the old behaviour, applying strict rules of
|
||||
* the spec can be turned off. This has effect only on special
|
||||
* mechanisms like whitespace-stripping in the stylesheet.
|
||||
@@ -1353,7 +1353,7 @@ struct _xsltCompilerCtxt {
|
||||
xsltNsAliasPtr nsAliases;
|
||||
xsltVarInfoPtr ivars; /* Storage of local in-scope variables/params. */
|
||||
xsltVarInfoPtr ivar; /* topmost local variable/param. */
|
||||
};
|
||||
};
|
||||
|
||||
#else /* XSLT_REFACTORED */
|
||||
/*
|
||||
@@ -1476,7 +1476,7 @@ struct _xsltPrincipalStylesheetData {
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Note that we added a @compCtxt field to anchor an stylesheet compilation
|
||||
@@ -1521,7 +1521,7 @@ struct _xsltStylesheet {
|
||||
void *textMatch; /* template based on text() */
|
||||
void *piMatch; /* template based on processing-instruction() */
|
||||
void *commentMatch; /* template based on comment() */
|
||||
|
||||
|
||||
/*
|
||||
* Namespace aliases.
|
||||
* NOTE: Not used in the refactored code.
|
||||
@@ -1542,7 +1542,7 @@ struct _xsltStylesheet {
|
||||
execution of XPath expressions; unfortunately
|
||||
it restricts the stylesheet to have distinct
|
||||
prefixes.
|
||||
TODO: We need to get rid of this.
|
||||
TODO: We need to get rid of this.
|
||||
*/
|
||||
void *nsDefs; /* ATTENTION TODO: This is currently used to store
|
||||
xsltExtDefPtr (in extensions.c) and
|
||||
@@ -1563,7 +1563,7 @@ struct _xsltStylesheet {
|
||||
xmlChar *encoding; /* encoding string */
|
||||
int omitXmlDeclaration; /* omit-xml-declaration = "yes" | "no" */
|
||||
|
||||
/*
|
||||
/*
|
||||
* Number formatting.
|
||||
*/
|
||||
xsltDecimalFormatPtr decimalFormat;
|
||||
@@ -1633,7 +1633,7 @@ struct _xsltStylesheet {
|
||||
*/
|
||||
xsltCompilerCtxtPtr compCtxt; /* TODO: Change this to (void *). */
|
||||
|
||||
xsltPrincipalStylesheetDataPtr principalData;
|
||||
xsltPrincipalStylesheetDataPtr principalData;
|
||||
#endif
|
||||
/*
|
||||
* Forwards-compatible processing
|
||||
@@ -1839,62 +1839,62 @@ struct _xsltTransformContext {
|
||||
xsltDecimalFormatPtr xsltDecimalFormatGetByName(xsltStylesheetPtr sheet,
|
||||
xmlChar *name);
|
||||
*/
|
||||
XSLTPUBFUN xsltStylesheetPtr XSLTCALL
|
||||
XSLTPUBFUN xsltStylesheetPtr XSLTCALL
|
||||
xsltNewStylesheet (void);
|
||||
XSLTPUBFUN xsltStylesheetPtr XSLTCALL
|
||||
XSLTPUBFUN xsltStylesheetPtr XSLTCALL
|
||||
xsltParseStylesheetFile (const xmlChar* filename);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeStylesheet (xsltStylesheetPtr style);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltIsBlank (xmlChar *str);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeStackElemList (xsltStackElemPtr elem);
|
||||
XSLTPUBFUN xsltDecimalFormatPtr XSLTCALL
|
||||
XSLTPUBFUN xsltDecimalFormatPtr XSLTCALL
|
||||
xsltDecimalFormatGetByName(xsltStylesheetPtr style,
|
||||
xmlChar *name);
|
||||
|
||||
XSLTPUBFUN xsltStylesheetPtr XSLTCALL
|
||||
XSLTPUBFUN xsltStylesheetPtr XSLTCALL
|
||||
xsltParseStylesheetProcess(xsltStylesheetPtr ret,
|
||||
xmlDocPtr doc);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltParseStylesheetOutput(xsltStylesheetPtr style,
|
||||
xmlNodePtr cur);
|
||||
XSLTPUBFUN xsltStylesheetPtr XSLTCALL
|
||||
XSLTPUBFUN xsltStylesheetPtr XSLTCALL
|
||||
xsltParseStylesheetDoc (xmlDocPtr doc);
|
||||
XSLTPUBFUN xsltStylesheetPtr XSLTCALL
|
||||
XSLTPUBFUN xsltStylesheetPtr XSLTCALL
|
||||
xsltParseStylesheetImportedDoc(xmlDocPtr doc,
|
||||
xsltStylesheetPtr style);
|
||||
XSLTPUBFUN xsltStylesheetPtr XSLTCALL
|
||||
XSLTPUBFUN xsltStylesheetPtr XSLTCALL
|
||||
xsltLoadStylesheetPI (xmlDocPtr doc);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltNumberFormat (xsltTransformContextPtr ctxt,
|
||||
xsltNumberDataPtr data,
|
||||
xmlNodePtr node);
|
||||
XSLTPUBFUN xmlXPathError XSLTCALL
|
||||
XSLTPUBFUN xmlXPathError XSLTCALL
|
||||
xsltFormatNumberConversion(xsltDecimalFormatPtr self,
|
||||
xmlChar *format,
|
||||
double number,
|
||||
xmlChar **result);
|
||||
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltParseTemplateContent(xsltStylesheetPtr style,
|
||||
xmlNodePtr templ);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltAllocateExtra (xsltStylesheetPtr style);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltAllocateExtraCtxt (xsltTransformContextPtr ctxt);
|
||||
/*
|
||||
* Extra functions for Result Value Trees
|
||||
*/
|
||||
XSLTPUBFUN xmlDocPtr XSLTCALL
|
||||
XSLTPUBFUN xmlDocPtr XSLTCALL
|
||||
xsltCreateRVT (xsltTransformContextPtr ctxt);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltRegisterTmpRVT (xsltTransformContextPtr ctxt,
|
||||
xmlDocPtr RVT);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltRegisterLocalRVT (xsltTransformContextPtr ctxt,
|
||||
xmlDocPtr RVT);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltRegisterPersistRVT (xsltTransformContextPtr ctxt,
|
||||
xmlDocPtr RVT);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
@@ -1943,7 +1943,7 @@ XSLTPUBFUN void XSLTCALL
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
#ifdef XSLT_REFACTORED
|
||||
#ifdef XSLT_REFACTORED
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltParseSequenceConstructor(
|
||||
xsltCompilerCtxtPtr cctxt,
|
||||
|
@@ -99,41 +99,41 @@ xsltNewLocale(const xmlChar *languageTag) {
|
||||
const char *region = NULL;
|
||||
char *q = localeName;
|
||||
int i, llen;
|
||||
|
||||
|
||||
/* Convert something like "pt-br" to "pt_BR.utf8" */
|
||||
|
||||
|
||||
if (languageTag == NULL)
|
||||
return(NULL);
|
||||
|
||||
return(NULL);
|
||||
|
||||
for (i=0; i<XSLTMAX_ISO639LANGLEN && ISALPHA(*p); ++i)
|
||||
*q++ = TOLOWER(*p++);
|
||||
|
||||
|
||||
if (i == 0)
|
||||
return(NULL);
|
||||
|
||||
return(NULL);
|
||||
|
||||
llen = i;
|
||||
|
||||
|
||||
if (*p) {
|
||||
if (*p++ != '-')
|
||||
return(NULL);
|
||||
if (*p++ != '-')
|
||||
return(NULL);
|
||||
*q++ = '_';
|
||||
|
||||
|
||||
for (i=0; i<XSLTMAX_ISO3166CNTRYLEN && ISALPHA(*p); ++i)
|
||||
*q++ = TOUPPER(*p++);
|
||||
|
||||
if (i == 0 || *p)
|
||||
return(NULL);
|
||||
|
||||
|
||||
if (i == 0 || *p)
|
||||
return(NULL);
|
||||
|
||||
memcpy(q, ".utf8", 6);
|
||||
locale = newlocale(LC_COLLATE_MASK, localeName, NULL);
|
||||
if (locale != NULL)
|
||||
return(locale);
|
||||
|
||||
|
||||
/* Continue without using country code */
|
||||
|
||||
|
||||
q = localeName + llen;
|
||||
}
|
||||
|
||||
|
||||
/* Try locale without territory, e.g. for Esperanto (eo) */
|
||||
|
||||
memcpy(q, ".utf8", 6);
|
||||
@@ -142,21 +142,21 @@ xsltNewLocale(const xmlChar *languageTag) {
|
||||
return(locale);
|
||||
|
||||
/* Try to find most common country for language */
|
||||
|
||||
|
||||
if (llen != 2)
|
||||
return(NULL);
|
||||
|
||||
region = (char *)xsltDefaultRegion((xmlChar *)localeName);
|
||||
if (region == NULL)
|
||||
return(NULL);
|
||||
|
||||
|
||||
q = localeName + llen;
|
||||
*q++ = '_';
|
||||
*q++ = region[0];
|
||||
*q++ = region[1];
|
||||
memcpy(q, ".utf8", 6);
|
||||
locale = newlocale(LC_COLLATE_MASK, localeName, NULL);
|
||||
|
||||
|
||||
return(locale);
|
||||
#endif
|
||||
|
||||
@@ -181,7 +181,7 @@ xsltNewLocale(const xmlChar *languageTag) {
|
||||
*q++ = '-';
|
||||
if (*p) { /*if country tag is given*/
|
||||
if (*p++ != '-') goto end;
|
||||
|
||||
|
||||
for (i=0; i<XSLTMAX_ISO3166CNTRYLEN && ISALPHA(*p); ++i)
|
||||
*q++ = TOUPPER(*p++);
|
||||
if (i == 0 || *p) goto end;
|
||||
@@ -211,10 +211,10 @@ xsltDefaultRegion(const xmlChar *localeName) {
|
||||
xmlChar c;
|
||||
/* region should be xmlChar, but gcc warns on all string assignments */
|
||||
const char *region = NULL;
|
||||
|
||||
|
||||
c = localeName[1];
|
||||
/* This is based on the locales from glibc 2.3.3 */
|
||||
|
||||
|
||||
switch (localeName[0]) {
|
||||
case 'a':
|
||||
if (c == 'a' || c == 'm') region = "ET";
|
||||
@@ -375,7 +375,7 @@ xsltStrxfrm(xsltLocale locale, const xmlChar *string)
|
||||
#else
|
||||
size_t xstrlen, r;
|
||||
xsltLocaleChar *xstr;
|
||||
|
||||
|
||||
#ifdef XSLT_LOCALE_XLOCALE
|
||||
xstrlen = strxfrm_l(NULL, (const char *)string, 0, locale) + 1;
|
||||
xstr = (xsltLocaleChar *) xmlMalloc(xstrlen);
|
||||
|
@@ -54,9 +54,9 @@
|
||||
#endif /* WIN32 */
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Convenience function *
|
||||
* *
|
||||
* *
|
||||
* Convenience function *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -326,7 +326,7 @@ error:
|
||||
* -1 in case of an error.
|
||||
*/
|
||||
int
|
||||
xsltPointerListAddSize(xsltPointerListPtr list,
|
||||
xsltPointerListAddSize(xsltPointerListPtr list,
|
||||
void *item,
|
||||
int initialSize)
|
||||
{
|
||||
@@ -422,9 +422,9 @@ xsltPointerListClear(xsltPointerListPtr list)
|
||||
#endif /* XSLT_REFACTORED */
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Handling of XSLT stylesheets messages *
|
||||
* *
|
||||
* *
|
||||
* Handling of XSLT stylesheets messages *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -477,9 +477,9 @@ xsltMessage(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst) {
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Handling of out of context errors *
|
||||
* *
|
||||
* *
|
||||
* Handling of out of context errors *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
#define XSLT_GET_VAR_STR(msg, str) { \
|
||||
@@ -489,14 +489,14 @@ xsltMessage(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst) {
|
||||
va_list ap; \
|
||||
\
|
||||
str = (char *) xmlMalloc(150); \
|
||||
if (str == NULL) \
|
||||
if (str == NULL) \
|
||||
return; \
|
||||
\
|
||||
size = 150; \
|
||||
\
|
||||
while (size < 64000) { \
|
||||
va_start(ap, msg); \
|
||||
chars = vsnprintf(str, size, msg, ap); \
|
||||
chars = vsnprintf(str, size, msg, ap); \
|
||||
va_end(ap); \
|
||||
if ((chars > -1) && (chars < size)) \
|
||||
break; \
|
||||
@@ -516,7 +516,7 @@ xsltMessage(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst) {
|
||||
* @ctx: an error context
|
||||
* @msg: the message to display/transmit
|
||||
* @...: extra parameters for the message display
|
||||
*
|
||||
*
|
||||
* Default handler for out of context error messages.
|
||||
*/
|
||||
static void
|
||||
@@ -562,7 +562,7 @@ xsltSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) {
|
||||
* @ctx: an error context
|
||||
* @msg: the message to display/transmit
|
||||
* @...: extra parameters for the message display
|
||||
*
|
||||
*
|
||||
* Default handler for out of context error messages.
|
||||
*/
|
||||
static void
|
||||
@@ -644,8 +644,8 @@ xsltPrintErrorContext(xsltTransformContextPtr ctxt,
|
||||
if (node->name != NULL)
|
||||
name = node->name;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (ctxt != NULL)
|
||||
type = "runtime error";
|
||||
else if (style != NULL) {
|
||||
@@ -731,9 +731,9 @@ xsltTransformError(xsltTransformContextPtr ctxt,
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* QNames *
|
||||
* *
|
||||
* *
|
||||
* QNames *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -808,9 +808,9 @@ xsltGetQNameURI(xmlNodePtr node, xmlChar ** name)
|
||||
* we are not trying to validate but just to cut, and yes it will
|
||||
* work even if this is a set of UTF-8 encoded chars
|
||||
*/
|
||||
while ((qname[len] != 0) && (qname[len] != ':'))
|
||||
while ((qname[len] != 0) && (qname[len] != ':'))
|
||||
len++;
|
||||
|
||||
|
||||
if (qname[len] == 0)
|
||||
return(NULL);
|
||||
|
||||
@@ -915,11 +915,11 @@ xsltGetQNameURI2(xsltStylesheetPtr style, xmlNodePtr node,
|
||||
xmlFree(qname);
|
||||
return(ns->href);
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Sorting *
|
||||
* *
|
||||
* *
|
||||
* Sorting *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -974,7 +974,7 @@ xsltComputeSortResult(xsltTransformContextPtr ctxt, xmlNodePtr sort) {
|
||||
xmlNodeSetPtr list = NULL;
|
||||
xmlXPathObjectPtr res;
|
||||
int len = 0;
|
||||
int i;
|
||||
int i;
|
||||
xmlNodePtr oldNode;
|
||||
xmlNodePtr oldInst;
|
||||
int oldPos, oldSize ;
|
||||
@@ -1090,7 +1090,7 @@ xsltComputeSortResult(xsltTransformContextPtr ctxt, xmlNodePtr sort) {
|
||||
* reorder the current node list accordingly to the set of sorting
|
||||
* requirement provided by the arry of nodes.
|
||||
*/
|
||||
void
|
||||
void
|
||||
xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
|
||||
int nbsorts) {
|
||||
#ifdef XSLT_REFACTORED
|
||||
@@ -1107,7 +1107,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
|
||||
int tst;
|
||||
int depth;
|
||||
xmlNodePtr node;
|
||||
xmlXPathObjectPtr tmp;
|
||||
xmlXPathObjectPtr tmp;
|
||||
int tempstype[XSLT_MAX_SORT], temporder[XSLT_MAX_SORT];
|
||||
|
||||
if ((ctxt == NULL) || (sorts == NULL) || (nbsorts <= 0) ||
|
||||
@@ -1187,7 +1187,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
|
||||
j = i - incr;
|
||||
if (results[i] == NULL)
|
||||
continue;
|
||||
|
||||
|
||||
while (j >= 0) {
|
||||
if (results[j] == NULL)
|
||||
tst = 1;
|
||||
@@ -1205,7 +1205,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
|
||||
else if (results[j]->floatval ==
|
||||
results[j + incr]->floatval)
|
||||
tst = 0;
|
||||
else if (results[j]->floatval >
|
||||
else if (results[j]->floatval >
|
||||
results[j + incr]->floatval)
|
||||
tst = 1;
|
||||
else tst = -1;
|
||||
@@ -1213,10 +1213,10 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
|
||||
tst = xsltLocaleStrcmp(
|
||||
comp->locale,
|
||||
(xsltLocaleChar *) results[j]->stringval,
|
||||
(xsltLocaleChar *) results[j + incr]->stringval);
|
||||
(xsltLocaleChar *) results[j + incr]->stringval);
|
||||
} else {
|
||||
tst = xmlStrcmp(results[j]->stringval,
|
||||
results[j + incr]->stringval);
|
||||
results[j + incr]->stringval);
|
||||
}
|
||||
if (descending)
|
||||
tst = -tst;
|
||||
@@ -1239,11 +1239,11 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
|
||||
* Compute the result of the next level for the
|
||||
* full set, this might be optimized ... or not
|
||||
*/
|
||||
if (resultsTab[depth] == NULL)
|
||||
if (resultsTab[depth] == NULL)
|
||||
resultsTab[depth] = xsltComputeSortResult(ctxt,
|
||||
sorts[depth]);
|
||||
res = resultsTab[depth];
|
||||
if (res == NULL)
|
||||
if (res == NULL)
|
||||
break;
|
||||
if (res[j] == NULL) {
|
||||
if (res[j+incr] != NULL)
|
||||
@@ -1254,7 +1254,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
|
||||
accordance with XSLT spec */
|
||||
if (xmlXPathIsNaN(res[j]->floatval)) {
|
||||
if (xmlXPathIsNaN(res[j +
|
||||
incr]->floatval))
|
||||
incr]->floatval))
|
||||
tst = 0;
|
||||
else
|
||||
tst = -1;
|
||||
@@ -1264,7 +1264,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
|
||||
else if (res[j]->floatval == res[j + incr]->
|
||||
floatval)
|
||||
tst = 0;
|
||||
else if (res[j]->floatval >
|
||||
else if (res[j]->floatval >
|
||||
res[j + incr]->floatval)
|
||||
tst = 1;
|
||||
else tst = -1;
|
||||
@@ -1272,10 +1272,10 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
|
||||
tst = xsltLocaleStrcmp(
|
||||
comp->locale,
|
||||
(xsltLocaleChar *) res[j]->stringval,
|
||||
(xsltLocaleChar *) res[j + incr]->stringval);
|
||||
(xsltLocaleChar *) res[j + incr]->stringval);
|
||||
} else {
|
||||
tst = xmlStrcmp(res[j]->stringval,
|
||||
res[j + incr]->stringval);
|
||||
res[j + incr]->stringval);
|
||||
}
|
||||
if (desc)
|
||||
tst = -tst;
|
||||
@@ -1387,32 +1387,32 @@ xsltSetSortFunc(xsltSortFunc handler) {
|
||||
* @handler: the new handler function
|
||||
*
|
||||
* Function to set the handler for XSLT sorting
|
||||
* for the specified context.
|
||||
* for the specified context.
|
||||
* If the handler is NULL, then the global
|
||||
* sort function will be called
|
||||
*/
|
||||
void
|
||||
void
|
||||
xsltSetCtxtSortFunc(xsltTransformContextPtr ctxt, xsltSortFunc handler) {
|
||||
ctxt->sortfunc = handler;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Parsing options *
|
||||
* *
|
||||
* *
|
||||
* Parsing options *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
* xsltSetCtxtParseOptions:
|
||||
* @ctxt: a XSLT process context
|
||||
* @options: a combination of libxml2 xmlParserOption
|
||||
*
|
||||
* Change the default parser option passed by the XSLT engine to the
|
||||
*
|
||||
* Change the default parser option passed by the XSLT engine to the
|
||||
* parser when using document() loading.
|
||||
*
|
||||
* Returns the previous options or -1 in case of error
|
||||
*/
|
||||
int
|
||||
int
|
||||
xsltSetCtxtParseOptions(xsltTransformContextPtr ctxt, int options)
|
||||
{
|
||||
int oldopts;
|
||||
@@ -1431,9 +1431,9 @@ xsltSetCtxtParseOptions(xsltTransformContextPtr ctxt, int options)
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Output *
|
||||
* *
|
||||
* *
|
||||
* Output *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -1524,7 +1524,7 @@ xsltSaveResultTo(xmlOutputBufferPtr buf, xmlDocPtr result,
|
||||
cur = cur->next;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
do {
|
||||
cur = cur->parent;
|
||||
if (cur == NULL)
|
||||
@@ -1745,7 +1745,7 @@ xsltSaveResultToFd(int fd, xmlDocPtr result, xsltStylesheetPtr style) {
|
||||
* Returns 0 in case of success and -1 in case of error
|
||||
*/
|
||||
int
|
||||
xsltSaveResultToString(xmlChar **doc_txt_ptr, int * doc_txt_len,
|
||||
xsltSaveResultToString(xmlChar **doc_txt_ptr, int * doc_txt_len,
|
||||
xmlDocPtr result, xsltStylesheetPtr style) {
|
||||
xmlOutputBufferPtr buf;
|
||||
const xmlChar *encoding;
|
||||
@@ -1793,9 +1793,9 @@ xsltSaveResultToString(xmlChar **doc_txt_ptr, int * doc_txt_len,
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Generating profiling informations *
|
||||
* *
|
||||
* *
|
||||
* Generating profiling informations *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
static long calibration = -1;
|
||||
@@ -1912,7 +1912,7 @@ xsltTimestamp(void)
|
||||
tics = (cur.tv_sec - startup.tv_sec) * XSLT_TIMESTAMP_TICS_PER_SEC;
|
||||
tics += (cur.tv_usec - startup.tv_usec) /
|
||||
(1000000l / XSLT_TIMESTAMP_TICS_PER_SEC);
|
||||
|
||||
|
||||
tics -= calibration;
|
||||
return(tics);
|
||||
#else
|
||||
@@ -1930,7 +1930,7 @@ pretty_templ_match(xsltTemplatePtr templ) {
|
||||
static char dst[1001];
|
||||
char *src = (char *)templ->match;
|
||||
int i=0,j;
|
||||
|
||||
|
||||
/* strip white spaces */
|
||||
for (j=0; i<1000 && src[j]; i++,j++) {
|
||||
for(;src[j]==' ';j++);
|
||||
@@ -2055,11 +2055,11 @@ xsltSaveProfiling(xsltTransformContextPtr ctxt, FILE *output) {
|
||||
childt = xmlMalloc((nb + 1) * sizeof(int));
|
||||
if (childt == NULL)
|
||||
return;
|
||||
|
||||
|
||||
/* precalculate children times */
|
||||
for (i = 0; i < nb; i++) {
|
||||
templ1 = templates[i];
|
||||
|
||||
|
||||
childt[i] = 0;
|
||||
for (k = 0; k < nb; k++) {
|
||||
templ2 = templates[k];
|
||||
@@ -2071,9 +2071,9 @@ xsltSaveProfiling(xsltTransformContextPtr ctxt, FILE *output) {
|
||||
}
|
||||
}
|
||||
childt[i] = 0;
|
||||
|
||||
|
||||
fprintf(output, "\nindex %% time self children called name\n");
|
||||
|
||||
|
||||
for (i = 0; i < nb; i++) {
|
||||
char ix_str[20], timep_str[20], times_str[20], timec_str[20], called_str[20];
|
||||
int t;
|
||||
@@ -2103,7 +2103,7 @@ xsltSaveProfiling(xsltTransformContextPtr ctxt, FILE *output) {
|
||||
sprintf(times_str,"%8.3f",(float)templ1->time/XSLT_TIMESTAMP_TICS_PER_SEC);
|
||||
sprintf(timec_str,"%8.3f",(float)childt[i]/XSLT_TIMESTAMP_TICS_PER_SEC);
|
||||
fprintf(output, "%-5s %-6s %-8s %-8s %6d %s [%d]\n",
|
||||
ix_str, timep_str,times_str,timec_str,
|
||||
ix_str, timep_str,times_str,timec_str,
|
||||
templ1->nbCalls,
|
||||
templ1->name?(char *)templ1->name:pretty_templ_match(templ1),i);
|
||||
/* callees
|
||||
@@ -2136,7 +2136,7 @@ xsltSaveProfiling(xsltTransformContextPtr ctxt, FILE *output) {
|
||||
}
|
||||
fprintf(output, "-----------------------------------------------\n");
|
||||
}
|
||||
|
||||
|
||||
fprintf(output, "\f\nIndex by function name\n");
|
||||
for (i = 0; i < nb; i++) {
|
||||
templ1 = templates[i];
|
||||
@@ -2144,7 +2144,7 @@ xsltSaveProfiling(xsltTransformContextPtr ctxt, FILE *output) {
|
||||
i, templ1->name?(char *)templ1->name:pretty_templ_match(templ1),
|
||||
templ1->style->doc->URL,templ1->elem->line);
|
||||
}
|
||||
|
||||
|
||||
fprintf(output, "\f\n");
|
||||
xmlFree(childt);
|
||||
|
||||
@@ -2152,9 +2152,9 @@ xsltSaveProfiling(xsltTransformContextPtr ctxt, FILE *output) {
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Fetching profiling informations *
|
||||
* *
|
||||
* *
|
||||
* Fetching profiling informations *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -2267,9 +2267,9 @@ xsltGetProfileInformation(xsltTransformContextPtr ctxt)
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Hooks for libxml2 XPath *
|
||||
* *
|
||||
* *
|
||||
* Hooks for libxml2 XPath *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -2354,9 +2354,9 @@ xsltXPathCompile(xsltStylesheetPtr style, const xmlChar *str) {
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Hooks for the debugger *
|
||||
* *
|
||||
* *
|
||||
* Hooks for the debugger *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/*
|
||||
@@ -2384,18 +2384,18 @@ int xslDebugStatus;
|
||||
/**
|
||||
* xsltSetDebuggerStatus:
|
||||
* @value : the value to be set
|
||||
*
|
||||
*
|
||||
* This function sets the value of xslDebugStatus.
|
||||
*/
|
||||
void
|
||||
xsltSetDebuggerStatus(int value)
|
||||
{
|
||||
xslDebugStatus = value;
|
||||
xslDebugStatus = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* xsltGetDebuggerStatus:
|
||||
*
|
||||
* xsltGetDebuggerStatus:
|
||||
*
|
||||
* Get xslDebugStatus.
|
||||
*
|
||||
* Returns the value of xslDebugStatus.
|
||||
@@ -2403,16 +2403,16 @@ xsltSetDebuggerStatus(int value)
|
||||
int
|
||||
xsltGetDebuggerStatus(void)
|
||||
{
|
||||
return(xslDebugStatus);
|
||||
return(xslDebugStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
* xsltSetDebuggerCallbacks:
|
||||
* @no : number of callbacks
|
||||
* @block : the block of callbacks
|
||||
*
|
||||
*
|
||||
* This function allow to plug a debugger into the XSLT library
|
||||
* @block points to a block of memory containing the address of @no
|
||||
* @block points to a block of memory containing the address of @no
|
||||
* callback routines.
|
||||
*
|
||||
* Returns 0 in case of success and -1 in case of error
|
||||
@@ -2437,9 +2437,9 @@ xsltSetDebuggerCallbacks(int no, void *block)
|
||||
* @cur : source node being executed
|
||||
* @node : data node being processed
|
||||
* @templ : temlate that applies to node
|
||||
* @ctxt : the xslt transform context
|
||||
*
|
||||
* If either cur or node are a breakpoint, or xslDebugStatus in state
|
||||
* @ctxt : the xslt transform context
|
||||
*
|
||||
* If either cur or node are a breakpoint, or xslDebugStatus in state
|
||||
* where debugging must occcur at this time then transfer control
|
||||
* to the xslDebugBreak function
|
||||
*/
|
||||
@@ -2457,7 +2457,7 @@ xslHandleDebugger(xmlNodePtr cur, xmlNodePtr node, xsltTemplatePtr templ,
|
||||
* @source : the source node being processed
|
||||
*
|
||||
* Add template "call" to call stack
|
||||
* Returns : 1 on sucess 0 otherwise an error may be printed if
|
||||
* Returns : 1 on sucess 0 otherwise an error may be printed if
|
||||
* WITH_XSLT_DEBUG_BREAKPOINTS is defined
|
||||
*/
|
||||
int
|
||||
|
@@ -31,7 +31,7 @@ extern "C" {
|
||||
*
|
||||
* Macro to flag unimplemented blocks.
|
||||
*/
|
||||
#define XSLT_TODO \
|
||||
#define XSLT_TODO \
|
||||
xsltGenericError(xsltGenericErrorContext, \
|
||||
"Unimplemented block at %s:%d\n", \
|
||||
__FILE__, __LINE__);
|
||||
@@ -41,7 +41,7 @@ extern "C" {
|
||||
*
|
||||
* Macro to flag that a problem was detected internally.
|
||||
*/
|
||||
#define XSLT_STRANGE \
|
||||
#define XSLT_STRANGE \
|
||||
xsltGenericError(xsltGenericErrorContext, \
|
||||
"Internal error at %s:%d\n", \
|
||||
__FILE__, __LINE__);
|
||||
@@ -77,7 +77,7 @@ extern "C" {
|
||||
((n)->type == XML_DOCUMENT_NODE) || \
|
||||
((n)->type == XML_HTML_DOCUMENT_NODE) || \
|
||||
((n)->type == XML_COMMENT_NODE) || \
|
||||
((n)->type == XML_PI_NODE)))
|
||||
((n)->type == XML_PI_NODE)))
|
||||
|
||||
/*
|
||||
* Our own version of namespaced atributes lookup.
|
||||
@@ -100,24 +100,24 @@ XSLTPUBFUN int XSLTCALL
|
||||
*/
|
||||
typedef enum {
|
||||
XSLT_TRACE_ALL = -1,
|
||||
XSLT_TRACE_NONE = 0,
|
||||
XSLT_TRACE_COPY_TEXT = 1<<0,
|
||||
XSLT_TRACE_PROCESS_NODE = 1<<1,
|
||||
XSLT_TRACE_APPLY_TEMPLATE = 1<<2,
|
||||
XSLT_TRACE_COPY = 1<<3,
|
||||
XSLT_TRACE_COMMENT = 1<<4,
|
||||
XSLT_TRACE_PI = 1<<5,
|
||||
XSLT_TRACE_COPY_OF = 1<<6,
|
||||
XSLT_TRACE_VALUE_OF = 1<<7,
|
||||
XSLT_TRACE_CALL_TEMPLATE = 1<<8,
|
||||
XSLT_TRACE_APPLY_TEMPLATES = 1<<9,
|
||||
XSLT_TRACE_CHOOSE = 1<<10,
|
||||
XSLT_TRACE_IF = 1<<11,
|
||||
XSLT_TRACE_FOR_EACH = 1<<12,
|
||||
XSLT_TRACE_STRIP_SPACES = 1<<13,
|
||||
XSLT_TRACE_TEMPLATES = 1<<14,
|
||||
XSLT_TRACE_KEYS = 1<<15,
|
||||
XSLT_TRACE_VARIABLES = 1<<16
|
||||
XSLT_TRACE_NONE = 0,
|
||||
XSLT_TRACE_COPY_TEXT = 1<<0,
|
||||
XSLT_TRACE_PROCESS_NODE = 1<<1,
|
||||
XSLT_TRACE_APPLY_TEMPLATE = 1<<2,
|
||||
XSLT_TRACE_COPY = 1<<3,
|
||||
XSLT_TRACE_COMMENT = 1<<4,
|
||||
XSLT_TRACE_PI = 1<<5,
|
||||
XSLT_TRACE_COPY_OF = 1<<6,
|
||||
XSLT_TRACE_VALUE_OF = 1<<7,
|
||||
XSLT_TRACE_CALL_TEMPLATE = 1<<8,
|
||||
XSLT_TRACE_APPLY_TEMPLATES = 1<<9,
|
||||
XSLT_TRACE_CHOOSE = 1<<10,
|
||||
XSLT_TRACE_IF = 1<<11,
|
||||
XSLT_TRACE_FOR_EACH = 1<<12,
|
||||
XSLT_TRACE_STRIP_SPACES = 1<<13,
|
||||
XSLT_TRACE_TEMPLATES = 1<<14,
|
||||
XSLT_TRACE_KEYS = 1<<15,
|
||||
XSLT_TRACE_VARIABLES = 1<<16
|
||||
} xsltDebugTraceCodes;
|
||||
|
||||
/**
|
||||
@@ -142,26 +142,26 @@ XSLTPUBVAR void *xsltGenericErrorContext;
|
||||
XSLTPUBVAR xmlGenericErrorFunc xsltGenericDebug;
|
||||
XSLTPUBVAR void *xsltGenericDebugContext;
|
||||
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltPrintErrorContext (xsltTransformContextPtr ctxt,
|
||||
xsltStylesheetPtr style,
|
||||
xmlNodePtr node);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltMessage (xsltTransformContextPtr ctxt,
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltMessage (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr inst);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSetGenericErrorFunc (void *ctx,
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSetGenericErrorFunc (void *ctx,
|
||||
xmlGenericErrorFunc handler);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSetGenericDebugFunc (void *ctx,
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSetGenericDebugFunc (void *ctx,
|
||||
xmlGenericErrorFunc handler);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSetTransformErrorFunc (xsltTransformContextPtr ctxt,
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSetTransformErrorFunc (xsltTransformContextPtr ctxt,
|
||||
void *ctx,
|
||||
xmlGenericErrorFunc handler);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltTransformError (xsltTransformContextPtr ctxt,
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltTransformError (xsltTransformContextPtr ctxt,
|
||||
xsltStylesheetPtr style,
|
||||
xmlNodePtr node,
|
||||
const char *msg,
|
||||
@@ -174,23 +174,23 @@ XSLTPUBFUN int XSLTCALL
|
||||
* Sorting.
|
||||
*/
|
||||
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltDocumentSortFunction (xmlNodeSetPtr list);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSetSortFunc (xsltSortFunc handler);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSetCtxtSortFunc (xsltTransformContextPtr ctxt,
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltDocumentSortFunction (xmlNodeSetPtr list);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSetSortFunc (xsltSortFunc handler);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSetCtxtSortFunc (xsltTransformContextPtr ctxt,
|
||||
xsltSortFunc handler);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltDefaultSortFunction (xsltTransformContextPtr ctxt,
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltDefaultSortFunction (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr *sorts,
|
||||
int nbsorts);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltDoSortFunction (xsltTransformContextPtr ctxt,
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltDoSortFunction (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr * sorts,
|
||||
int nbsorts);
|
||||
XSLTPUBFUN xmlXPathObjectPtr * XSLTCALL
|
||||
xsltComputeSortResult (xsltTransformContextPtr ctxt,
|
||||
XSLTPUBFUN xmlXPathObjectPtr * XSLTCALL
|
||||
xsltComputeSortResult (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr sort);
|
||||
|
||||
/*
|
||||
@@ -201,8 +201,8 @@ XSLTPUBFUN const xmlChar * XSLTCALL
|
||||
xsltSplitQName (xmlDictPtr dict,
|
||||
const xmlChar *name,
|
||||
const xmlChar **prefix);
|
||||
XSLTPUBFUN const xmlChar * XSLTCALL
|
||||
xsltGetQNameURI (xmlNodePtr node,
|
||||
XSLTPUBFUN const xmlChar * XSLTCALL
|
||||
xsltGetQNameURI (xmlNodePtr node,
|
||||
xmlChar **name);
|
||||
|
||||
XSLTPUBFUN const xmlChar * XSLTCALL
|
||||
@@ -213,27 +213,27 @@ XSLTPUBFUN const xmlChar * XSLTCALL
|
||||
/*
|
||||
* Output, reuse libxml I/O buffers.
|
||||
*/
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSaveResultTo (xmlOutputBufferPtr buf,
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSaveResultTo (xmlOutputBufferPtr buf,
|
||||
xmlDocPtr result,
|
||||
xsltStylesheetPtr style);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSaveResultToFilename (const char *URI,
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSaveResultToFilename (const char *URI,
|
||||
xmlDocPtr result,
|
||||
xsltStylesheetPtr style,
|
||||
int compression);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSaveResultToFile (FILE *file,
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSaveResultToFile (FILE *file,
|
||||
xmlDocPtr result,
|
||||
xsltStylesheetPtr style);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSaveResultToFd (int fd,
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSaveResultToFd (int fd,
|
||||
xmlDocPtr result,
|
||||
xsltStylesheetPtr style);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSaveResultToString (xmlChar **doc_txt_ptr,
|
||||
int * doc_txt_len,
|
||||
xmlDocPtr result,
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSaveResultToString (xmlChar **doc_txt_ptr,
|
||||
int * doc_txt_len,
|
||||
xmlDocPtr result,
|
||||
xsltStylesheetPtr style);
|
||||
|
||||
/*
|
||||
@@ -250,16 +250,16 @@ XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
|
||||
/*
|
||||
* Profiling.
|
||||
*/
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSaveProfiling (xsltTransformContextPtr ctxt,
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSaveProfiling (xsltTransformContextPtr ctxt,
|
||||
FILE *output);
|
||||
XSLTPUBFUN xmlDocPtr XSLTCALL
|
||||
xsltGetProfileInformation (xsltTransformContextPtr ctxt);
|
||||
XSLTPUBFUN xmlDocPtr XSLTCALL
|
||||
xsltGetProfileInformation (xsltTransformContextPtr ctxt);
|
||||
|
||||
XSLTPUBFUN long XSLTCALL
|
||||
xsltTimestamp (void);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltCalibrateAdjust (long delta);
|
||||
XSLTPUBFUN long XSLTCALL
|
||||
xsltTimestamp (void);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltCalibrateAdjust (long delta);
|
||||
|
||||
/**
|
||||
* XSLT_TIMESTAMP_TICS_PER_SEC:
|
||||
@@ -296,12 +296,12 @@ XSLTPUBFUN void XSLTCALL
|
||||
xsltSetDebuggerStatus (int value);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltGetDebuggerStatus (void);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSetDebuggerCallbacks (int no, void *block);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xslAddCall (xsltTemplatePtr templ,
|
||||
xmlNodePtr source);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xslDropCall (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Summary: compile-time version informations for the XSLT engine
|
||||
* Summary: compile-time version informations for the XSLT engine
|
||||
* when compiled on windows
|
||||
* Description: compile-time version informations for the XSLT engine
|
||||
* when compiled on windows. This file is generated.
|
||||
|
@@ -100,7 +100,7 @@ libxslt_xsltGetTransformContextHashCode(PyObject *self ATTRIBUTE_UNUSED, PyObjec
|
||||
long hash_code;
|
||||
xsltTransformContextPtr tctxt;
|
||||
|
||||
if (!PyArg_ParseTuple(args, (char *)"O:getTransformContextHashCode",
|
||||
if (!PyArg_ParseTuple(args, (char *)"O:getTransformContextHashCode",
|
||||
&py_tctxt))
|
||||
return NULL;
|
||||
|
||||
@@ -113,11 +113,11 @@ libxslt_xsltGetTransformContextHashCode(PyObject *self ATTRIBUTE_UNUSED, PyObjec
|
||||
|
||||
PyObject *
|
||||
libxslt_xsltCompareTransformContextsEqual(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
|
||||
|
||||
|
||||
PyObject *py_tctxt1, *py_tctxt2;
|
||||
xsltTransformContextPtr tctxt1, tctxt2;
|
||||
|
||||
if (!PyArg_ParseTuple(args, (char *)"OO:compareTransformContextsEqual",
|
||||
if (!PyArg_ParseTuple(args, (char *)"OO:compareTransformContextsEqual",
|
||||
&py_tctxt1, &py_tctxt2))
|
||||
return NULL;
|
||||
|
||||
@@ -137,7 +137,7 @@ libxslt_xsltGetStylesheetHashCode(PyObject *self ATTRIBUTE_UNUSED, PyObject *arg
|
||||
long hash_code;
|
||||
xsltStylesheetPtr style;
|
||||
|
||||
if (!PyArg_ParseTuple(args, (char *)"O:getStylesheetHashCode",
|
||||
if (!PyArg_ParseTuple(args, (char *)"O:getStylesheetHashCode",
|
||||
&py_style))
|
||||
return NULL;
|
||||
|
||||
@@ -151,11 +151,11 @@ libxslt_xsltGetStylesheetHashCode(PyObject *self ATTRIBUTE_UNUSED, PyObject *arg
|
||||
|
||||
PyObject *
|
||||
libxslt_xsltCompareStylesheetsEqual(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
|
||||
|
||||
|
||||
PyObject *py_style1, *py_style2;
|
||||
xsltStylesheetPtr style1, style2;
|
||||
|
||||
if (!PyArg_ParseTuple(args, (char *)"OO:compareStylesheetsEqual",
|
||||
if (!PyArg_ParseTuple(args, (char *)"OO:compareStylesheetsEqual",
|
||||
&py_style1, &py_style2))
|
||||
return NULL;
|
||||
|
||||
@@ -240,12 +240,12 @@ libxslt_xsltElementPreCompCallback(xsltStylesheetPtr style, xmlNodePtr inst,
|
||||
|
||||
if (style == NULL)
|
||||
return (NULL);
|
||||
|
||||
|
||||
if (inst != NULL && inst->ns != NULL) {
|
||||
name = inst->name;
|
||||
ns_uri = inst->ns->href;
|
||||
} else {
|
||||
xsltTransformError(NULL, style, inst,
|
||||
xsltTransformError(NULL, style, inst,
|
||||
"libxslt_xsltElementPreCompCallback: internal error bad parameter\n");
|
||||
printf("libxslt_xsltElementPreCompCallback: internal error bad parameter\n");
|
||||
if (style != NULL) style->errors++;
|
||||
@@ -258,7 +258,7 @@ libxslt_xsltElementPreCompCallback(xsltStylesheetPtr style, xmlNodePtr inst,
|
||||
pyobj_precomp_f = xmlHashLookup2(libxslt_extModuleElementPreComp,
|
||||
name, ns_uri);
|
||||
if (pyobj_precomp_f == NULL) {
|
||||
xsltTransformError(NULL, style, inst,
|
||||
xsltTransformError(NULL, style, inst,
|
||||
"libxslt_xsltElementPreCompCallback: internal error, could not find precompile python function!\n");
|
||||
if (style != NULL) style->errors++;
|
||||
return (NULL);
|
||||
@@ -267,13 +267,13 @@ libxslt_xsltElementPreCompCallback(xsltStylesheetPtr style, xmlNodePtr inst,
|
||||
pyobj_element_f = xmlHashLookup2(libxslt_extModuleElements,
|
||||
name, ns_uri);
|
||||
if (pyobj_element_f == NULL) {
|
||||
xsltTransformError(NULL, style, inst,
|
||||
xsltTransformError(NULL, style, inst,
|
||||
"libxslt_xsltElementPreCompCallback: internal error, could not find element python function!\n");
|
||||
if (style != NULL) style->errors++;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
args = Py_BuildValue((char *)"(OOO)",
|
||||
args = Py_BuildValue((char *)"(OOO)",
|
||||
libxslt_xsltStylesheetPtrWrap(style),
|
||||
libxml_xmlNodePtrWrap(inst),
|
||||
pyobj_element_f);
|
||||
@@ -295,9 +295,9 @@ libxslt_xsltElementPreCompCallback(xsltStylesheetPtr style, xmlNodePtr inst,
|
||||
|
||||
static void
|
||||
libxslt_xsltElementTransformCallback(xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr inst,
|
||||
xsltElemPreCompPtr comp)
|
||||
xsltElemPreCompPtr comp)
|
||||
{
|
||||
PyObject *args, *result;
|
||||
PyObject *func = NULL;
|
||||
@@ -306,7 +306,7 @@ libxslt_xsltElementTransformCallback(xsltTransformContextPtr ctxt,
|
||||
|
||||
if (ctxt == NULL)
|
||||
return;
|
||||
|
||||
|
||||
if (inst != NULL && inst->name != NULL && inst->ns != NULL && inst->ns->href != NULL) {
|
||||
name = inst->name;
|
||||
ns_uri = inst->ns->href;
|
||||
@@ -331,10 +331,10 @@ libxslt_xsltElementTransformCallback(xsltTransformContextPtr ctxt,
|
||||
}
|
||||
|
||||
args = Py_BuildValue((char *)"OOOO",
|
||||
libxslt_xsltTransformContextPtrWrap(ctxt),
|
||||
libxml_xmlNodePtrWrap(node),
|
||||
libxml_xmlNodePtrWrap(inst),
|
||||
libxslt_xsltElemPreCompPtrWrap(comp));
|
||||
libxslt_xsltTransformContextPtrWrap(ctxt),
|
||||
libxml_xmlNodePtrWrap(node),
|
||||
libxml_xmlNodePtrWrap(inst),
|
||||
libxslt_xsltElemPreCompPtrWrap(comp));
|
||||
|
||||
Py_INCREF(func); /* Protect refcount against reentrant manipulation of callback hash */
|
||||
result = PyEval_CallObject(func, args);
|
||||
@@ -401,7 +401,7 @@ libxslt_xsltRegisterExtModuleElement(PyObject *self ATTRIBUTE_UNUSED,
|
||||
}
|
||||
Py_XINCREF(pyobj_precomp_f);
|
||||
|
||||
ret = xsltRegisterExtModuleElement(name, ns_uri,
|
||||
ret = xsltRegisterExtModuleElement(name, ns_uri,
|
||||
libxslt_xsltElementPreCompCallback,
|
||||
libxslt_xsltElementTransformCallback);
|
||||
py_retval = libxml_intWrap((int) ret);
|
||||
@@ -495,7 +495,7 @@ libxslt_xsltRegisterExtModuleFunction(PyObject *self ATTRIBUTE_UNUSED,
|
||||
}
|
||||
Py_XINCREF(pyobj_f);
|
||||
|
||||
ret = xsltRegisterExtModuleFunction(name, ns_uri,
|
||||
ret = xsltRegisterExtModuleFunction(name, ns_uri,
|
||||
libxslt_xmlXPathFuncCallback);
|
||||
py_retval = libxml_intWrap((int) ret);
|
||||
return(py_retval);
|
||||
@@ -536,7 +536,7 @@ pythonDocLoaderFuncWrapper(const xmlChar * URI, xmlDictPtr dict, int options,
|
||||
xmlCtxtUseOptions(pctxt, options);
|
||||
|
||||
/*
|
||||
* Now pass to python the URI, the xsltParserContext and the context
|
||||
* Now pass to python the URI, the xsltParserContext and the context
|
||||
* (either a transformContext or a stylesheet) and get back an xmlDocPtr
|
||||
*/
|
||||
if (pythonDocLoaderObject != NULL) {
|
||||
@@ -545,13 +545,13 @@ pythonDocLoaderFuncWrapper(const xmlChar * URI, xmlDictPtr dict, int options,
|
||||
|
||||
if (type == XSLT_LOAD_DOCUMENT) {
|
||||
ctxtobj = libxslt_xsltTransformContextPtrWrap(ctxt);
|
||||
result = PyObject_CallFunction(pythonDocLoaderObject,
|
||||
(char *) "(sOOi)", URI, pctxtobj, ctxtobj, 0);
|
||||
result = PyObject_CallFunction(pythonDocLoaderObject,
|
||||
(char *) "(sOOi)", URI, pctxtobj, ctxtobj, 0);
|
||||
}
|
||||
else {
|
||||
ctxtobj = libxslt_xsltStylesheetPtrWrap(ctxt);
|
||||
result = PyObject_CallFunction(pythonDocLoaderObject,
|
||||
(char *) "(sOOi)", URI, pctxtobj, ctxtobj, 1);
|
||||
result = PyObject_CallFunction(pythonDocLoaderObject,
|
||||
(char *) "(sOOi)", URI, pctxtobj, ctxtobj, 1);
|
||||
}
|
||||
|
||||
Py_XDECREF(pctxtobj);
|
||||
@@ -599,7 +599,7 @@ libxslt_xsltSetLoaderFunc(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
|
||||
xsltSetLoaderFunc(pythonDocLoaderFuncWrapper);
|
||||
|
||||
py_retval = PyInt_FromLong(0);
|
||||
return(py_retval);
|
||||
return(py_retval);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
@@ -607,7 +607,7 @@ libxslt_xsltGetLoaderFunc(void) {
|
||||
PyObject *py_retval;
|
||||
|
||||
py_retval = pythonDocLoaderObject;
|
||||
return(py_retval);
|
||||
return(py_retval);
|
||||
}
|
||||
|
||||
|
||||
@@ -632,7 +632,7 @@ libxslt_xsltNewTransformContext(PyObject *self ATTRIBUTE_UNUSED, PyObject *args)
|
||||
|
||||
style = (xsltStylesheetPtr) Pystylesheet_Get(pyobj_style);
|
||||
doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc);
|
||||
|
||||
|
||||
c_retval = xsltNewTransformContext(style, doc);
|
||||
py_retval = libxslt_xsltTransformContextPtrWrap((xsltTransformContextPtr) c_retval);
|
||||
return (py_retval);
|
||||
@@ -645,13 +645,13 @@ libxslt_xsltFreeTransformContext(PyObject *self ATTRIBUTE_UNUSED, PyObject *args
|
||||
|
||||
if (!PyArg_ParseTuple(args, (char *) "O:xsltFreeTransformContext", &py_tctxt))
|
||||
return(NULL);
|
||||
|
||||
|
||||
tctxt = (xsltTransformContextPtr) PytransformCtxt_Get(py_tctxt);
|
||||
xsltFreeTransformContext(tctxt);
|
||||
|
||||
/* Return None */
|
||||
Py_INCREF(Py_None);
|
||||
return(Py_None);
|
||||
return(Py_None);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
@@ -808,7 +808,7 @@ libxslt_xsltApplyStylesheet(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
|
||||
|
||||
PyObject *
|
||||
libxslt_xsltSaveResultToString(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
|
||||
PyObject *py_retval; /* our final return value, a python string */
|
||||
PyObject *py_retval; /* our final return value, a python string */
|
||||
xmlChar *buffer;
|
||||
int size = 0;
|
||||
int emitted = 0;
|
||||
@@ -822,14 +822,14 @@ libxslt_xsltSaveResultToString(PyObject *self ATTRIBUTE_UNUSED, PyObject *args)
|
||||
result = (xmlDocPtr) PyxmlNode_Get(pyobj_result);
|
||||
style = (xsltStylesheetPtr) Pystylesheet_Get(pyobj_style);
|
||||
|
||||
|
||||
|
||||
/* FIXME: We should probably add more restrictive error checking
|
||||
* and raise an error instead of "just" returning NULL.
|
||||
* FIXME: Documentation and code for xsltSaveResultToString diff
|
||||
* -> emmitted will never be positive non-null.
|
||||
* -> emmitted will never be positive non-null.
|
||||
*/
|
||||
emitted = xsltSaveResultToString(&buffer, &size, result, style);
|
||||
if(!buffer || emitted < 0)
|
||||
if(!buffer || emitted < 0)
|
||||
goto FAIL;
|
||||
/* We haven't tested the aberrant case of a transformation that
|
||||
* renders to an empty string. For now we try to play it safe.
|
||||
@@ -837,7 +837,7 @@ libxslt_xsltSaveResultToString(PyObject *self ATTRIBUTE_UNUSED, PyObject *args)
|
||||
if(size)
|
||||
{
|
||||
buffer[size] = '\0';
|
||||
py_retval = PyString_FromString((char *) buffer);
|
||||
py_retval = PyString_FromString((char *) buffer);
|
||||
xmlFree(buffer);
|
||||
}
|
||||
else
|
||||
@@ -1125,7 +1125,7 @@ libxslt_xsltRegisterExtensionClass(PyObject *self ATTRIBUTE_UNUSED,
|
||||
}
|
||||
Py_XINCREF(pyobj_c);
|
||||
|
||||
ret = xsltRegisterExtModuleFull(ns_uri,
|
||||
ret = xsltRegisterExtModuleFull(ns_uri,
|
||||
(xsltExtInitFunction) libxslt_xsltPythonExtModuleCtxtInit,
|
||||
(xsltExtShutdownFunction) libxslt_xsltPythonExtModuleCtxtShutdown,
|
||||
(xsltStyleExtInitFunction) libxslt_xsltPythonExtModuleStyleInit,
|
||||
|
@@ -403,7 +403,7 @@ libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
|
||||
for (i = 0; i < obj->nodesetval->nodeNr; i++) {
|
||||
node = obj->nodesetval->nodeTab[i];
|
||||
if (node->type == XML_NAMESPACE_DECL) {
|
||||
PyObject *ns =
|
||||
PyObject *ns =
|
||||
PyCObject_FromVoidPtrAndDesc((void *) node,
|
||||
(char *) "xmlNsPtr",
|
||||
libxml_xmlXPathDestructNsNode);
|
||||
|
Reference in New Issue
Block a user