ReactOS 0.4.16-dev-2279-gc890759
xsltutils.h File Reference
#include <libxslt/xsltconfig.h>
#include <libxml/xpath.h>
#include <libxml/dict.h>
#include <libxml/xmlerror.h>
#include "xsltexports.h"
#include "xsltInternals.h"
Include dependency graph for xsltutils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define XSLT_TODO
 
#define XSLT_STRANGE
 
#define IS_XSLT_ELEM(n)
 
#define IS_XSLT_NAME(n, val)    (xmlStrEqual((n)->name, (const xmlChar *) (val)))
 
#define IS_XSLT_REAL_NODE(n)
 
#define XSLT_TRACE(ctxt, code, call)
 
#define XSLT_TIMESTAMP_TICS_PER_SEC   100000l
 

Typedefs

typedef void(* xsltHandleDebuggerCallback) (xmlNodePtr cur, xmlNodePtr node, xsltTemplatePtr templ, xsltTransformContextPtr ctxt)
 
typedef int(* xsltAddCallCallback) (xsltTemplatePtr templ, xmlNodePtr source)
 
typedef void(* xsltDropCallCallback) (void)
 

Enumerations

enum  xsltDebugTraceCodes {
  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
}
 
enum  xsltDebugStatusCodes {
  XSLT_DEBUG_NONE = 0 , XSLT_DEBUG_INIT , XSLT_DEBUG_STEP , XSLT_DEBUG_STEPOUT ,
  XSLT_DEBUG_NEXT , XSLT_DEBUG_STOP , XSLT_DEBUG_CONT , XSLT_DEBUG_RUN ,
  XSLT_DEBUG_RUN_RESTART , XSLT_DEBUG_QUIT
}
 

Functions

XSLTPUBFUN xmlChar *XSLTCALL xsltGetNsProp (xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace)
 
XSLTPUBFUN const xmlChar *XSLTCALL xsltGetCNsProp (xsltStylesheetPtr style, xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace)
 
XSLTPUBFUN int XSLTCALL xsltGetUTF8Char (const unsigned char *utf, int *len)
 
XSLTPUBFUN void XSLTCALL xsltDebugSetDefaultTrace (xsltDebugTraceCodes val)
 
XSLTPUBFUN xsltDebugTraceCodes XSLTCALL xsltDebugGetDefaultTrace (void)
 
XSLTPUBFUN void XSLTCALL xsltPrintErrorContext (xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node)
 
XSLTPUBFUN void XSLTCALL xsltMessage (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst)
 
XSLTPUBFUN void XSLTCALL xsltSetGenericErrorFunc (void *ctx, xmlGenericErrorFunc handler)
 
XSLTPUBFUN void XSLTCALL xsltSetGenericDebugFunc (void *ctx, xmlGenericErrorFunc handler)
 
XSLTPUBFUN void XSLTCALL xsltSetTransformErrorFunc (xsltTransformContextPtr ctxt, void *ctx, xmlGenericErrorFunc handler)
 
XSLTPUBFUN void XSLTCALL xsltTransformError (xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node, const char *msg,...) LIBXSLT_ATTR_FORMAT(4
 
XSLTPUBFUN void XSLTCALL XSLTPUBFUN int XSLTCALL xsltSetCtxtParseOptions (xsltTransformContextPtr ctxt, int options)
 
XSLTPUBFUN void XSLTCALL xsltDocumentSortFunction (xmlNodeSetPtr list)
 
XSLTPUBFUN void XSLTCALL xsltSetSortFunc (xsltSortFunc handler)
 
XSLTPUBFUN void XSLTCALL xsltSetCtxtSortFunc (xsltTransformContextPtr ctxt, xsltSortFunc handler)
 
XSLTPUBFUN void XSLTCALL xsltSetCtxtLocaleHandlers (xsltTransformContextPtr ctxt, xsltNewLocaleFunc newLocale, xsltFreeLocaleFunc freeLocale, xsltGenSortKeyFunc genSortKey)
 
XSLTPUBFUN void XSLTCALL xsltDefaultSortFunction (xsltTransformContextPtr ctxt, xmlNodePtr *sorts, int nbsorts)
 
XSLTPUBFUN void XSLTCALL xsltDoSortFunction (xsltTransformContextPtr ctxt, xmlNodePtr *sorts, int nbsorts)
 
XSLTPUBFUN xmlXPathObjectPtr *XSLTCALL xsltComputeSortResult (xsltTransformContextPtr ctxt, xmlNodePtr sort)
 
XSLTPUBFUN const xmlChar *XSLTCALL xsltSplitQName (xmlDictPtr dict, const xmlChar *name, const xmlChar **prefix)
 
XSLTPUBFUN const xmlChar *XSLTCALL xsltGetQNameURI (xmlNodePtr node, xmlChar **name)
 
XSLTPUBFUN const xmlChar *XSLTCALL xsltGetQNameURI2 (xsltStylesheetPtr style, xmlNodePtr node, const xmlChar **name)
 
XSLTPUBFUN int XSLTCALL xsltSaveResultTo (xmlOutputBufferPtr buf, xmlDocPtr result, xsltStylesheetPtr style)
 
XSLTPUBFUN int XSLTCALL xsltSaveResultToFilename (const char *URI, xmlDocPtr result, xsltStylesheetPtr style, int compression)
 
XSLTPUBFUN int XSLTCALL xsltSaveResultToFile (FILE *file, xmlDocPtr result, xsltStylesheetPtr style)
 
XSLTPUBFUN int XSLTCALL xsltSaveResultToFd (int fd, xmlDocPtr result, xsltStylesheetPtr style)
 
XSLTPUBFUN int XSLTCALL xsltSaveResultToString (xmlChar **doc_txt_ptr, int *doc_txt_len, xmlDocPtr result, xsltStylesheetPtr style)
 
XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL xsltXPathCompile (xsltStylesheetPtr style, const xmlChar *str)
 
XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL xsltXPathCompileFlags (xsltStylesheetPtr style, const xmlChar *str, int flags)
 
XSLTPUBFUN int XSLTCALL xsltGetDebuggerStatus (void)
 

Variables

XSLTPUBVAR xmlGenericErrorFunc xsltGenericError
 
XSLTPUBVAR voidxsltGenericErrorContext
 
XSLTPUBVAR xmlGenericErrorFunc xsltGenericDebug
 
XSLTPUBVAR voidxsltGenericDebugContext
 
XSLTPUBVAR int xslDebugStatus
 

Macro Definition Documentation

◆ IS_XSLT_ELEM

#define IS_XSLT_ELEM (   n)
Value:
(((n) != NULL) && ((n)->type == XML_ELEMENT_NODE) && \
((n)->ns != NULL) && (xmlStrEqual((n)->ns->href, XSLT_NAMESPACE)))
#define NULL
Definition: types.h:112
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble n
Definition: glext.h:7729
Definition: mxnamespace.c:38
XMLPUBFUN int xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:162
#define XSLT_NAMESPACE
Definition: xslt.h:46

IS_XSLT_ELEM:

Checks that the element pertains to XSLT namespace.

Definition at line 51 of file xsltutils.h.

◆ IS_XSLT_NAME

#define IS_XSLT_NAME (   n,
  val 
)     (xmlStrEqual((n)->name, (const xmlChar *) (val)))

IS_XSLT_NAME:

Checks the value of an element in XSLT namespace.

Definition at line 60 of file xsltutils.h.

◆ IS_XSLT_REAL_NODE

#define IS_XSLT_REAL_NODE (   n)
Value:
(((n) != NULL) && \
(((n)->type == XML_ELEMENT_NODE) || \
((n)->type == XML_TEXT_NODE) || \
((n)->type == XML_CDATA_SECTION_NODE) || \
((n)->type == XML_ATTRIBUTE_NODE) || \
((n)->type == XML_DOCUMENT_NODE) || \
((n)->type == XML_HTML_DOCUMENT_NODE) || \
((n)->type == XML_COMMENT_NODE) || \
((n)->type == XML_PI_NODE)))

IS_XSLT_REAL_NODE:

Check that a node is a 'real' one: document, element, text or attribute.

Definition at line 68 of file xsltutils.h.

◆ XSLT_STRANGE

#define XSLT_STRANGE
Value:
"Internal error at %s:%d\n", \
__FILE__, __LINE__);
XSLTPUBVAR void * xsltGenericErrorContext
Definition: xsltutils.h:145
XSLTPUBVAR xmlGenericErrorFunc xsltGenericError
Definition: xsltutils.h:144

XSLT_STRANGE:

Macro to flag that a problem was detected internally.

Definition at line 41 of file xsltutils.h.

◆ XSLT_TIMESTAMP_TICS_PER_SEC

#define XSLT_TIMESTAMP_TICS_PER_SEC   100000l

XSLT_TIMESTAMP_TICS_PER_SEC:

Sampling precision for profiling

Definition at line 297 of file xsltutils.h.

◆ XSLT_TODO

#define XSLT_TODO
Value:
"Unimplemented block at %s:%d\n", \
__FILE__, __LINE__);

XSLT_TODO:

Macro to flag unimplemented blocks.

Definition at line 31 of file xsltutils.h.

◆ XSLT_TRACE

#define XSLT_TRACE (   ctxt,
  code,
  call 
)
Value:
if (ctxt->traceCode && (*(ctxt->traceCode) & code)) \
call
Definition: inflate.c:139

XSLT_TRACE:

Control the type of xsl debugtrace messages emitted.

Definition at line 132 of file xsltutils.h.

Typedef Documentation

◆ xsltAddCallCallback

typedef int(* xsltAddCallCallback) (xsltTemplatePtr templ, xmlNodePtr source)

Definition at line 320 of file xsltutils.h.

◆ xsltDropCallCallback

typedef void(* xsltDropCallCallback) (void)

Definition at line 321 of file xsltutils.h.

◆ xsltHandleDebuggerCallback

typedef void(* xsltHandleDebuggerCallback) (xmlNodePtr cur, xmlNodePtr node, xsltTemplatePtr templ, xsltTransformContextPtr ctxt)

Definition at line 318 of file xsltutils.h.

Enumeration Type Documentation

◆ xsltDebugStatusCodes

Enumerator
XSLT_DEBUG_NONE 
XSLT_DEBUG_INIT 
XSLT_DEBUG_STEP 
XSLT_DEBUG_STEPOUT 
XSLT_DEBUG_NEXT 
XSLT_DEBUG_STOP 
XSLT_DEBUG_CONT 
XSLT_DEBUG_RUN 
XSLT_DEBUG_RUN_RESTART 
XSLT_DEBUG_QUIT 

Definition at line 303 of file xsltutils.h.

303 {
304 XSLT_DEBUG_NONE = 0, /* no debugging allowed */
xsltDebugStatusCodes
Definition: xsltutils.h:303
@ XSLT_DEBUG_STEP
Definition: xsltutils.h:306
@ XSLT_DEBUG_CONT
Definition: xsltutils.h:310
@ XSLT_DEBUG_STEPOUT
Definition: xsltutils.h:307
@ XSLT_DEBUG_INIT
Definition: xsltutils.h:305
@ XSLT_DEBUG_QUIT
Definition: xsltutils.h:313
@ XSLT_DEBUG_NEXT
Definition: xsltutils.h:308
@ XSLT_DEBUG_NONE
Definition: xsltutils.h:304
@ XSLT_DEBUG_RUN_RESTART
Definition: xsltutils.h:312
@ XSLT_DEBUG_STOP
Definition: xsltutils.h:309
@ XSLT_DEBUG_RUN
Definition: xsltutils.h:311

◆ xsltDebugTraceCodes

Enumerator
XSLT_TRACE_ALL 
XSLT_TRACE_NONE 
XSLT_TRACE_COPY_TEXT 
XSLT_TRACE_PROCESS_NODE 
XSLT_TRACE_APPLY_TEMPLATE 
XSLT_TRACE_COPY 
XSLT_TRACE_COMMENT 
XSLT_TRACE_PI 
XSLT_TRACE_COPY_OF 
XSLT_TRACE_VALUE_OF 
XSLT_TRACE_CALL_TEMPLATE 
XSLT_TRACE_APPLY_TEMPLATES 
XSLT_TRACE_CHOOSE 
XSLT_TRACE_IF 
XSLT_TRACE_FOR_EACH 
XSLT_TRACE_STRIP_SPACES 
XSLT_TRACE_TEMPLATES 
XSLT_TRACE_KEYS 
XSLT_TRACE_VARIABLES 

Definition at line 105 of file xsltutils.h.

105 {
106 XSLT_TRACE_ALL = -1,
107 XSLT_TRACE_NONE = 0,
111 XSLT_TRACE_COPY = 1<<3,
112 XSLT_TRACE_COMMENT = 1<<4,
113 XSLT_TRACE_PI = 1<<5,
114 XSLT_TRACE_COPY_OF = 1<<6,
115 XSLT_TRACE_VALUE_OF = 1<<7,
118 XSLT_TRACE_CHOOSE = 1<<10,
119 XSLT_TRACE_IF = 1<<11,
120 XSLT_TRACE_FOR_EACH = 1<<12,
122 XSLT_TRACE_TEMPLATES = 1<<14,
123 XSLT_TRACE_KEYS = 1<<15,
xsltDebugTraceCodes
Definition: xsltutils.h:105
@ XSLT_TRACE_VALUE_OF
Definition: xsltutils.h:115
@ XSLT_TRACE_FOR_EACH
Definition: xsltutils.h:120
@ XSLT_TRACE_COPY_OF
Definition: xsltutils.h:114
@ XSLT_TRACE_ALL
Definition: xsltutils.h:106
@ XSLT_TRACE_TEMPLATES
Definition: xsltutils.h:122
@ XSLT_TRACE_APPLY_TEMPLATE
Definition: xsltutils.h:110
@ XSLT_TRACE_COPY_TEXT
Definition: xsltutils.h:108
@ XSLT_TRACE_NONE
Definition: xsltutils.h:107
@ XSLT_TRACE_COPY
Definition: xsltutils.h:111
@ XSLT_TRACE_PROCESS_NODE
Definition: xsltutils.h:109
@ XSLT_TRACE_CHOOSE
Definition: xsltutils.h:118
@ XSLT_TRACE_COMMENT
Definition: xsltutils.h:112
@ XSLT_TRACE_PI
Definition: xsltutils.h:113
@ XSLT_TRACE_KEYS
Definition: xsltutils.h:123
@ XSLT_TRACE_CALL_TEMPLATE
Definition: xsltutils.h:116
@ XSLT_TRACE_STRIP_SPACES
Definition: xsltutils.h:121
@ XSLT_TRACE_APPLY_TEMPLATES
Definition: xsltutils.h:117
@ XSLT_TRACE_VARIABLES
Definition: xsltutils.h:124
@ XSLT_TRACE_IF
Definition: xsltutils.h:119

Function Documentation

◆ xsltComputeSortResult()

XSLTPUBFUN xmlXPathObjectPtr *XSLTCALL xsltComputeSortResult ( xsltTransformContextPtr  ctxt,
xmlNodePtr  sort 
)

xsltComputeSortResult: @ctxt: a XSLT process context @sort: node list

reorder the current node list accordingly to the set of sorting requirement provided by the array of nodes.

Returns a ordered XPath nodeset or NULL in case of error.

Definition at line 1161 of file xsltutils.c.

1161 {
1162 const xsltStylePreComp *comp = sort->psvi;
1163 int number = 0;
1164
1165 if (comp != NULL)
1166 number = comp->number;
1168 /* locale */ NULL);
1169}
static struct @457 sort
static unsigned int number
Definition: dsound.c:1479
static xmlXPathObjectPtr * xsltComputeSortResultInternal(xsltTransformContextPtr ctxt, xmlNodePtr sort, int number, void *locale)
Definition: xsltutils.c:1023

◆ xsltDebugGetDefaultTrace()

XSLTPUBFUN xsltDebugTraceCodes XSLTCALL xsltDebugGetDefaultTrace ( void  )

xsltDebugGetDefaultTrace:

Get the current default debug tracing level mask

Returns the current default debug tracing level mask

Definition at line 488 of file transform.c.

488 {
489 return xsltDefaultTrace;
490}
static unsigned long xsltDefaultTrace
Definition: transform.c:469

◆ xsltDebugSetDefaultTrace()

XSLTPUBFUN void XSLTCALL xsltDebugSetDefaultTrace ( xsltDebugTraceCodes  val)

xsltDebugSetDefaultTrace: @val: tracing level mask

Set the default debug tracing level mask

Definition at line 477 of file transform.c.

477 {
479}
GLuint GLfloat * val
Definition: glext.h:7180

◆ xsltDefaultSortFunction()

XSLTPUBFUN void XSLTCALL xsltDefaultSortFunction ( xsltTransformContextPtr  ctxt,
xmlNodePtr *  sorts,
int  nbsorts 
)

xsltDefaultSortFunction: @ctxt: a XSLT process context @sorts: array of sort nodes @nbsorts: the number of sorts in the array

reorder the current node list accordingly to the set of sorting requirement provided by the arry of nodes.

Definition at line 1181 of file xsltutils.c.

1182 {
1183#ifdef XSLT_REFACTORED
1184 xsltStyleItemSortPtr comp;
1185#else
1186 const xsltStylePreComp *comp;
1187#endif
1188 xmlXPathObjectPtr *resultsTab[XSLT_MAX_SORT];
1189 xmlXPathObjectPtr *results = NULL, *res;
1190 xmlNodeSetPtr list = NULL;
1191 int len = 0;
1192 int i, j, incr;
1193 int tst;
1194 int depth;
1195 xmlNodePtr node;
1196 xmlXPathObjectPtr tmp;
1198 void *locale[XSLT_MAX_SORT];
1199
1200 if ((ctxt == NULL) || (sorts == NULL) || (nbsorts <= 0) ||
1201 (nbsorts >= XSLT_MAX_SORT))
1202 return;
1203 if (sorts[0] == NULL)
1204 return;
1205 comp = sorts[0]->psvi;
1206 if (comp == NULL)
1207 return;
1208
1209 list = ctxt->nodeList;
1210 if ((list == NULL) || (list->nodeNr <= 1))
1211 return; /* nothing to do */
1212
1213 for (j = 0; j < nbsorts; j++) {
1214 xmlChar *lang;
1215
1216 comp = sorts[j]->psvi;
1217 if ((comp->stype == NULL) && (comp->has_stype != 0)) {
1218 xmlChar *stype =
1219 xsltEvalAttrValueTemplate(ctxt, sorts[j],
1220 BAD_CAST "data-type", NULL);
1221 number[j] = 0;
1222 if (stype != NULL) {
1223 if (xmlStrEqual(stype, (const xmlChar *) "text"))
1224 ;
1225 else if (xmlStrEqual(stype, (const xmlChar *) "number"))
1226 number[j] = 1;
1227 else {
1228 xsltTransformError(ctxt, NULL, sorts[j],
1229 "xsltDoSortFunction: no support for data-type = %s\n",
1230 stype);
1231 }
1232 xmlFree(stype);
1233 }
1234 } else {
1235 number[j] = comp->number;
1236 }
1237 if ((comp->order == NULL) && (comp->has_order != 0)) {
1238 xmlChar *order = xsltEvalAttrValueTemplate(ctxt, sorts[j],
1239 BAD_CAST "order", NULL);
1240 desc[j] = 0;
1241 if (order != NULL) {
1242 if (xmlStrEqual(order, (const xmlChar *) "ascending"))
1243 ;
1244 else if (xmlStrEqual(order, (const xmlChar *) "descending"))
1245 desc[j] = 1;
1246 else {
1247 xsltTransformError(ctxt, NULL, sorts[j],
1248 "xsltDoSortFunction: invalid value %s for order\n",
1249 order);
1250 }
1251 xmlFree(order);
1252 }
1253 } else {
1254 desc[j] = comp->descending;
1255 }
1256 if ((comp->lang == NULL) && (comp->has_lang != 0)) {
1257 lang = xsltEvalAttrValueTemplate(ctxt, sorts[j],
1258 (xmlChar *) "lang",
1259 NULL);
1260 } else {
1261 lang = (xmlChar *) comp->lang;
1262 }
1263 if (lang != NULL) {
1264 locale[j] = ctxt->newLocale(lang, comp->lower_first);
1265 if (lang != comp->lang)
1266 xmlFree(lang);
1267 } else {
1268 locale[j] = NULL;
1269 }
1270 }
1271
1272 len = list->nodeNr;
1273
1274 resultsTab[0] = xsltComputeSortResultInternal(ctxt, sorts[0], number[0],
1275 locale[0]);
1276 for (i = 1;i < XSLT_MAX_SORT;i++)
1277 resultsTab[i] = NULL;
1278
1279 results = resultsTab[0];
1280
1281 comp = sorts[0]->psvi;
1282 if (results == NULL)
1283 goto cleanup;
1284
1285 /* Shell's sort of node-set */
1286 for (incr = len / 2; incr > 0; incr /= 2) {
1287 for (i = incr; i < len; i++) {
1288 j = i - incr;
1289 if (results[i] == NULL)
1290 continue;
1291
1292 while (j >= 0) {
1293 if (results[j] == NULL)
1294 tst = 1;
1295 else {
1296 if (number[0]) {
1297 /* We make NaN smaller than number in accordance
1298 with XSLT spec */
1299 if (xmlXPathIsNaN(results[j]->floatval)) {
1300 if (xmlXPathIsNaN(results[j + incr]->floatval))
1301 tst = 0;
1302 else
1303 tst = -1;
1304 } else if (xmlXPathIsNaN(results[j + incr]->floatval))
1305 tst = 1;
1306 else if (results[j]->floatval ==
1307 results[j + incr]->floatval)
1308 tst = 0;
1309 else if (results[j]->floatval >
1310 results[j + incr]->floatval)
1311 tst = 1;
1312 else tst = -1;
1313 } else {
1314 tst = xmlStrcmp(results[j]->stringval,
1315 results[j + incr]->stringval);
1316 }
1317 if (desc[0])
1318 tst = -tst;
1319 }
1320 if (tst == 0) {
1321 /*
1322 * Okay we need to use multi level sorts
1323 */
1324 depth = 1;
1325 while (depth < nbsorts) {
1326 if (sorts[depth] == NULL)
1327 break;
1328 comp = sorts[depth]->psvi;
1329 if (comp == NULL)
1330 break;
1331
1332 /*
1333 * Compute the result of the next level for the
1334 * full set, this might be optimized ... or not
1335 */
1336 if (resultsTab[depth] == NULL)
1337 resultsTab[depth] =
1339 sorts[depth],
1340 number[depth],
1341 locale[depth]);
1342 res = resultsTab[depth];
1343 if (res == NULL)
1344 break;
1345 if (res[j] == NULL) {
1346 if (res[j+incr] != NULL)
1347 tst = 1;
1348 } else if (res[j+incr] == NULL) {
1349 tst = -1;
1350 } else {
1351 if (number[depth]) {
1352 /* We make NaN smaller than number in
1353 accordance with XSLT spec */
1354 if (xmlXPathIsNaN(res[j]->floatval)) {
1355 if (xmlXPathIsNaN(res[j +
1356 incr]->floatval))
1357 tst = 0;
1358 else
1359 tst = -1;
1360 } else if (xmlXPathIsNaN(res[j + incr]->
1361 floatval))
1362 tst = 1;
1363 else if (res[j]->floatval == res[j + incr]->
1364 floatval)
1365 tst = 0;
1366 else if (res[j]->floatval >
1367 res[j + incr]->floatval)
1368 tst = 1;
1369 else tst = -1;
1370 } else {
1371 tst = xmlStrcmp(res[j]->stringval,
1372 res[j + incr]->stringval);
1373 }
1374 if (desc[depth])
1375 tst = -tst;
1376 }
1377
1378 /*
1379 * if we still can't differenciate at this level
1380 * try one level deeper.
1381 */
1382 if (tst != 0)
1383 break;
1384 depth++;
1385 }
1386 }
1387 if (tst == 0) {
1388 tst = results[j]->index > results[j + incr]->index;
1389 }
1390 if (tst > 0) {
1391 tmp = results[j];
1392 results[j] = results[j + incr];
1393 results[j + incr] = tmp;
1394 node = list->nodeTab[j];
1395 list->nodeTab[j] = list->nodeTab[j + incr];
1396 list->nodeTab[j + incr] = node;
1397 depth = 1;
1398 while (depth < nbsorts) {
1399 if (sorts[depth] == NULL)
1400 break;
1401 if (resultsTab[depth] == NULL)
1402 break;
1403 res = resultsTab[depth];
1404 tmp = res[j];
1405 res[j] = res[j + incr];
1406 res[j + incr] = tmp;
1407 depth++;
1408 }
1409 j -= incr;
1410 } else
1411 break;
1412 }
1413 }
1414 }
1415
1416cleanup:
1417 for (j = 0; j < nbsorts; j++) {
1418 if (locale[j] != NULL) {
1419 ctxt->freeLocale(locale[j]);
1420 }
1421 if (resultsTab[j] != NULL) {
1422 for (i = 0;i < len;i++)
1423 xmlXPathFreeObject(resultsTab[j][i]);
1424 xmlFree(resultsTab[j]);
1425 }
1426 }
1427}
static struct _test_info results[8]
Definition: SetCursorPos.c:31
const char * stype[]
Definition: cmds.c:192
Definition: list.h:37
Definition: _locale.h:75
static void cleanup(void)
Definition: main.c:1335
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
GLuint res
Definition: glext.h:9613
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1204
xmlFreeFunc xmlFree
Definition: globals.c:184
xsltNewLocaleFunc newLocale
xmlNodeSetPtr nodeList
xsltFreeLocaleFunc freeLocale
xmlChar * xsltEvalAttrValueTemplate(xsltTransformContextPtr ctxt, xmlNodePtr inst, const xmlChar *name, const xmlChar *ns)
Definition: templates.c:410
Definition: dlist.c:348
static const WCHAR lang[]
Definition: wbemdisp.c:287
XMLPUBFUN int xmlStrcmp(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:135
#define BAD_CAST
Definition: xmlstring.h:35
unsigned char xmlChar
Definition: xmlstring.h:28
#define XSLT_MAX_SORT
void xsltTransformError(xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node, const char *msg,...)
Definition: xsltutils.c:762

Referenced by xsltSetSortFunc().

◆ xsltDocumentSortFunction()

XSLTPUBFUN void XSLTCALL xsltDocumentSortFunction ( xmlNodeSetPtr  list)

xsltDocumentSortFunction: @list: the node set

reorder the current node list @list accordingly to the document order This function is slow, obsolete and should not be used anymore.

Definition at line 987 of file xsltutils.c.

987 {
988 int i, j;
989 int len, tst;
990 xmlNodePtr node;
991
992 if (list == NULL)
993 return;
994 len = list->nodeNr;
995 if (len <= 1)
996 return;
997 /* TODO: sort is really not optimized, does it needs to ? */
998 for (i = 0;i < len -1;i++) {
999 for (j = i + 1; j < len; j++) {
1000 tst = xmlXPathCmpNodes(list->nodeTab[i], list->nodeTab[j]);
1001 if (tst == -1) {
1002 node = list->nodeTab[i];
1003 list->nodeTab[i] = list->nodeTab[j];
1004 list->nodeTab[j] = node;
1005 }
1006 }
1007 }
1008}

◆ xsltDoSortFunction()

XSLTPUBFUN void XSLTCALL xsltDoSortFunction ( xsltTransformContextPtr  ctxt,
xmlNodePtr *  sorts,
int  nbsorts 
)

xsltDoSortFunction: @ctxt: a XSLT process context @sorts: array of sort nodes @nbsorts: the number of sorts in the array

reorder the current node list accordingly to the set of sorting requirement provided by the arry of nodes. This is a wrapper function, the actual function used is specified using xsltSetCtxtSortFunc() to set the context specific sort function, or xsltSetSortFunc() to set the global sort function. If a sort function is set on the context, this will get called. Otherwise the global sort function is called.

Definition at line 1447 of file xsltutils.c.

1449{
1450 if (ctxt->sortfunc != NULL)
1451 (ctxt->sortfunc)(ctxt, sorts, nbsorts);
1452 else if (xsltSortFunction != NULL)
1453 xsltSortFunction(ctxt, sorts, nbsorts);
1454}
static xsltSortFunc xsltSortFunction
Definition: xsltutils.c:1430

Referenced by xsltApplyTemplates(), and xsltForEach().

◆ xsltGetCNsProp()

XSLTPUBFUN const xmlChar *XSLTCALL xsltGetCNsProp ( xsltStylesheetPtr  style,
xmlNodePtr  node,
const xmlChar name,
const xmlChar nameSpace 
)

Definition at line 76 of file xsltutils.c.

77 {
78 xmlAttrPtr prop;
79 xmlDocPtr doc;
80 xmlNsPtr ns;
81 xmlChar *tmp;
82 const xmlChar *ret;
83
84 if ((node == NULL) || (style == NULL) || (style->dict == NULL))
85 return(NULL);
86
87 if (nameSpace == NULL)
88 return xmlGetProp(node, name);
89
90 if (node->type == XML_NAMESPACE_DECL)
91 return(NULL);
92 if (node->type == XML_ELEMENT_NODE)
93 prop = node->properties;
94 else
95 prop = NULL;
96 while (prop != NULL) {
97 /*
98 * One need to have
99 * - same attribute names
100 * - and the attribute carrying that namespace
101 */
102 if ((xmlStrEqual(prop->name, name)) &&
103 (((prop->ns == NULL) && (node->ns != NULL) &&
104 (xmlStrEqual(node->ns->href, nameSpace))) ||
105 ((prop->ns != NULL) &&
106 (xmlStrEqual(prop->ns->href, nameSpace))))) {
107
108 tmp = xmlNodeListGetString(node->doc, prop->children, 1);
109 if (tmp == NULL)
110 ret = xmlDictLookup(style->dict, BAD_CAST "", 0);
111 else {
112 ret = xmlDictLookup(style->dict, tmp, -1);
113 xmlFree(tmp);
114 }
115 return ret;
116 }
117 prop = prop->next;
118 }
119 tmp = NULL;
120 /*
121 * Check if there is a default declaration in the internal
122 * or external subsets
123 */
124 doc = node->doc;
125 if (doc != NULL) {
126 if (doc->intSubset != NULL) {
127 xmlAttributePtr attrDecl;
128
129 attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name);
130 if ((attrDecl == NULL) && (doc->extSubset != NULL))
131 attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name);
132
133 if ((attrDecl != NULL) && (attrDecl->prefix != NULL)) {
134 /*
135 * The DTD declaration only allows a prefix search
136 */
137 ns = xmlSearchNs(doc, node, attrDecl->prefix);
138 if ((ns != NULL) && (xmlStrEqual(ns->href, nameSpace)))
139 return(xmlDictLookup(style->dict,
140 attrDecl->defaultValue, -1));
141 }
142 }
143 }
144 return(NULL);
145}
Arabic default style
Definition: afstyles.h:94
return ret
Definition: mutex.c:146
const xmlChar * xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len)
Definition: dict.c:824
Definition: name.c:39
XMLPUBFUN xmlAttributePtr xmlGetDtdAttrDesc(xmlDtdPtr dtd, const xmlChar *elem, const xmlChar *name)
Definition: valid.c:3230

Referenced by xsltApplyTemplatesComp(), xsltCopyComp(), xsltCopyOfComp(), xsltForEachComp(), xsltGetQNameProperty(), xsltIfComp(), xsltNumberComp(), xsltParamComp(), xsltSortComp(), xsltTextComp(), xsltValueOfComp(), xsltVariableComp(), xsltWhenComp(), and xsltWithParamComp().

◆ xsltGetDebuggerStatus()

XSLTPUBFUN int XSLTCALL xsltGetDebuggerStatus ( void  )

xsltGetDebuggerStatus:

Get xslDebugStatus.

Returns the value of xslDebugStatus.

Definition at line 2613 of file xsltutils.c.

2614{
2615 return(xslDebugStatus);
2616}
int xslDebugStatus
Definition: xsltutils.c:2603

◆ xsltGetNsProp()

XSLTPUBFUN xmlChar *XSLTCALL xsltGetNsProp ( xmlNodePtr  node,
const xmlChar name,
const xmlChar nameSpace 
)

Definition at line 166 of file xsltutils.c.

166 {
167 xmlAttrPtr prop;
168 xmlDocPtr doc;
169 xmlNsPtr ns;
170
171 if (node == NULL)
172 return(NULL);
173
174 if (nameSpace == NULL)
175 return xmlGetProp(node, name);
176
177 if (node->type == XML_NAMESPACE_DECL)
178 return(NULL);
179 if (node->type == XML_ELEMENT_NODE)
180 prop = node->properties;
181 else
182 prop = NULL;
183 /*
184 * TODO: Substitute xmlGetProp() for xmlGetNsProp(), since the former
185 * is not namespace-aware and will return an attribute with equal
186 * name regardless of its namespace.
187 * Example:
188 * <xsl:element foo:name="myName"/>
189 * So this would return "myName" even if an attribute @name
190 * in the XSLT was requested.
191 */
192 while (prop != NULL) {
193 /*
194 * One need to have
195 * - same attribute names
196 * - and the attribute carrying that namespace
197 */
198 if ((xmlStrEqual(prop->name, name)) &&
199 (((prop->ns == NULL) && (node->ns != NULL) &&
200 (xmlStrEqual(node->ns->href, nameSpace))) ||
201 ((prop->ns != NULL) &&
202 (xmlStrEqual(prop->ns->href, nameSpace))))) {
203 xmlChar *ret;
204
205 ret = xmlNodeListGetString(node->doc, prop->children, 1);
206 if (ret == NULL) return(xmlStrdup((xmlChar *)""));
207 return(ret);
208 }
209 prop = prop->next;
210 }
211
212 /*
213 * Check if there is a default declaration in the internal
214 * or external subsets
215 */
216 doc = node->doc;
217 if (doc != NULL) {
218 if (doc->intSubset != NULL) {
219 xmlAttributePtr attrDecl;
220
221 attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name);
222 if ((attrDecl == NULL) && (doc->extSubset != NULL))
223 attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name);
224
225 if ((attrDecl != NULL) && (attrDecl->prefix != NULL)) {
226 /*
227 * The DTD declaration only allows a prefix search
228 */
229 ns = xmlSearchNs(doc, node, attrDecl->prefix);
230 if ((ns != NULL) && (xmlStrEqual(ns->href, nameSpace)))
231 return(xmlStrdup(attrDecl->defaultValue));
232 }
233 }
234 }
235 return(NULL);
236}
XMLPUBFUN xmlChar * xmlStrdup(const xmlChar *cur)
Definition: xmlstring.c:69

Referenced by xsltEvalAttrValueTemplate(), and xsltEvalStaticAttrValueTemplate().

◆ xsltGetQNameURI()

XSLTPUBFUN const xmlChar *XSLTCALL xsltGetQNameURI ( xmlNodePtr  node,
xmlChar **  name 
)

Definition at line 837 of file xsltutils.c.

838{
839 int len = 0;
840 xmlChar *qname;
841 xmlNsPtr ns;
842
843 if (name == NULL)
844 return(NULL);
845 qname = *name;
846 if ((qname == NULL) || (*qname == 0))
847 return(NULL);
848 if (node == NULL) {
850 "QName: no element for namespace lookup %s\n",
851 qname);
852 xmlFree(qname);
853 *name = NULL;
854 return(NULL);
855 }
856
857 /* nasty but valid */
858 if (qname[0] == ':')
859 return(NULL);
860
861 /*
862 * we are not trying to validate but just to cut, and yes it will
863 * work even if this is a set of UTF-8 encoded chars
864 */
865 while ((qname[len] != 0) && (qname[len] != ':'))
866 len++;
867
868 if (qname[len] == 0)
869 return(NULL);
870
871 /*
872 * handle xml: separately, this one is magical
873 */
874 if ((qname[0] == 'x') && (qname[1] == 'm') &&
875 (qname[2] == 'l') && (qname[3] == ':')) {
876 if (qname[4] == 0)
877 return(NULL);
878 *name = xmlStrdup(&qname[4]);
879 xmlFree(qname);
880 return(XML_XML_NAMESPACE);
881 }
882
883 qname[len] = 0;
884 ns = xmlSearchNs(node->doc, node, qname);
885 if (ns == NULL) {
887 "%s:%s : no namespace bound to prefix %s\n",
888 qname, &qname[len + 1], qname);
889 *name = NULL;
890 xmlFree(qname);
891 return(NULL);
892 }
893 *name = xmlStrdup(&qname[len + 1]);
894 xmlFree(qname);
895 return(ns->href);
896}
xmlGenericErrorFunc xsltGenericError
Definition: xsltutils.c:586
void * xsltGenericErrorContext
Definition: xsltutils.c:587

Referenced by xsltCompileStepPattern(), xsltDocumentElem(), xsltParseStylesheetDecimalFormat(), xsltParseStylesheetKey(), xsltParseStylesheetOutput(), xsltParseStylesheetPreserveSpace(), xsltParseStylesheetStripSpace(), and xsltParseStylesheetTemplate().

◆ xsltGetQNameURI2()

XSLTPUBFUN const xmlChar *XSLTCALL xsltGetQNameURI2 ( xsltStylesheetPtr  style,
xmlNodePtr  node,
const xmlChar **  name 
)

Definition at line 911 of file xsltutils.c.

912 {
913 int len = 0;
914 xmlChar *qname;
915 xmlNsPtr ns;
916
917 if (name == NULL)
918 return(NULL);
919 qname = (xmlChar *)*name;
920 if ((qname == NULL) || (*qname == 0))
921 return(NULL);
922 if (node == NULL) {
924 "QName: no element for namespace lookup %s\n",
925 qname);
926 *name = NULL;
927 return(NULL);
928 }
929
930 /*
931 * we are not trying to validate but just to cut, and yes it will
932 * work even if this is a set of UTF-8 encoded chars
933 */
934 while ((qname[len] != 0) && (qname[len] != ':'))
935 len++;
936
937 if (qname[len] == 0)
938 return(NULL);
939
940 /*
941 * handle xml: separately, this one is magical
942 */
943 if ((qname[0] == 'x') && (qname[1] == 'm') &&
944 (qname[2] == 'l') && (qname[3] == ':')) {
945 if (qname[4] == 0)
946 return(NULL);
947 *name = xmlDictLookup(style->dict, &qname[4], -1);
948 return(XML_XML_NAMESPACE);
949 }
950
951 qname = xmlStrndup(*name, len);
952 ns = xmlSearchNs(node->doc, node, qname);
953 if (ns == NULL) {
954 if (style) {
956 "No namespace bound to prefix '%s'.\n",
957 qname);
958 style->errors++;
959 } else {
961 "%s : no namespace bound to prefix %s\n",
962 *name, qname);
963 }
964 *name = NULL;
965 xmlFree(qname);
966 return(NULL);
967 }
968 *name = xmlDictLookup(style->dict, (*name)+len+1, -1);
969 xmlFree(qname);
970 return(ns->href);
971}
XMLPUBFUN xmlChar * xmlStrndup(const xmlChar *cur, int len)
Definition: xmlstring.c:45

Referenced by xsltGetQNameProperty().

◆ xsltGetUTF8Char()

XSLTPUBFUN int XSLTCALL xsltGetUTF8Char ( const unsigned char utf,
int len 
)

xsltGetUTF8Char: @utf: a sequence of UTF-8 encoded bytes @len: a pointer to @bytes len

Read one UTF8 Char from @utf Function copied from libxml2 xmlGetUTF8Char() ... to discard ultimately and use the original API

Returns the char value or -1 in case of error and update @len with the number of bytes used

Definition at line 251 of file xsltutils.c.

251 {
252 unsigned int c;
253
254 if (utf == NULL)
255 goto error;
256 if (len == NULL)
257 goto error;
258 if (*len < 1)
259 goto error;
260
261 c = utf[0];
262 if (c & 0x80) {
263 if (*len < 2)
264 goto error;
265 if ((utf[1] & 0xc0) != 0x80)
266 goto error;
267 if ((c & 0xe0) == 0xe0) {
268 if (*len < 3)
269 goto error;
270 if ((utf[2] & 0xc0) != 0x80)
271 goto error;
272 if ((c & 0xf0) == 0xf0) {
273 if (*len < 4)
274 goto error;
275 if ((c & 0xf8) != 0xf0 || (utf[3] & 0xc0) != 0x80)
276 goto error;
277 *len = 4;
278 /* 4-byte code */
279 c = (utf[0] & 0x7) << 18;
280 c |= (utf[1] & 0x3f) << 12;
281 c |= (utf[2] & 0x3f) << 6;
282 c |= utf[3] & 0x3f;
283 } else {
284 /* 3-byte code */
285 *len = 3;
286 c = (utf[0] & 0xf) << 12;
287 c |= (utf[1] & 0x3f) << 6;
288 c |= utf[2] & 0x3f;
289 }
290 } else {
291 /* 2-byte code */
292 *len = 2;
293 c = (utf[0] & 0x1f) << 6;
294 c |= utf[1] & 0x3f;
295 }
296 } else {
297 /* 1-byte code */
298 *len = 1;
299 }
300 return(c);
301
302error:
303 if (len != NULL)
304 *len = 0;
305 return(-1);
306}
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
#define error(str)
Definition: mkdosfs.c:1605

Referenced by xsltFormatNumberConversion(), and xsltNumberComp().

◆ xsltMessage()

XSLTPUBFUN void XSLTCALL xsltMessage ( xsltTransformContextPtr  ctxt,
xmlNodePtr  node,
xmlNodePtr  inst 
)

xsltMessage: @ctxt: an XSLT processing context @node: The current node @inst: The node containing the message instruction

Process and xsl:message construct

Definition at line 492 of file xsltutils.c.

492 {
494 void *errctx = xsltGenericErrorContext;
495 xmlChar *prop, *message;
496 int terminate = 0;
497
498 if ((ctxt == NULL) || (inst == NULL))
499 return;
500
501 if (ctxt->error != NULL) {
502 error = ctxt->error;
503 errctx = ctxt->errctx;
504 }
505
506 prop = xmlGetNsProp(inst, (const xmlChar *)"terminate", NULL);
507 if (prop != NULL) {
508 if (xmlStrEqual(prop, (const xmlChar *)"yes")) {
509 terminate = 1;
510 } else if (xmlStrEqual(prop, (const xmlChar *)"no")) {
511 terminate = 0;
512 } else {
513 xsltTransformError(ctxt, NULL, inst,
514 "xsl:message : terminate expecting 'yes' or 'no'\n");
515 }
516 xmlFree(prop);
517 }
518 message = xsltEvalTemplateString(ctxt, node, inst);
519 if (message != NULL) {
520 int len = xmlStrlen(message);
521
522 error(errctx, "%s", (const char *)message);
523 if ((len > 0) && (message[len - 1] != '\n'))
524 error(errctx, "\n");
526 }
527 if (terminate)
529}
void CDECL terminate(void)
Definition: cpp.c:701
xsltTransformState state
xmlGenericErrorFunc error
Definition: tftpd.h:60
xmlChar * xsltEvalTemplateString(xsltTransformContextPtr ctxt, xmlNodePtr contextNode, xmlNodePtr inst)
Definition: templates.c:207
void(* xmlGenericErrorFunc)(void *ctx, const char *msg,...) LIBXML_ATTR_FORMAT(2
Definition: xmlerror.h:848
XMLPUBFUN int xmlStrlen(const xmlChar *str)
Definition: xmlstring.c:428
@ XSLT_STATE_STOPPED

Referenced by xsltApplySequenceConstructor(), and xsltMessageWrapper().

◆ xsltPrintErrorContext()

XSLTPUBFUN void XSLTCALL xsltPrintErrorContext ( xsltTransformContextPtr  ctxt,
xsltStylesheetPtr  style,
xmlNodePtr  node 
)

xsltPrintErrorContext: @ctxt: the transformation context @style: the stylesheet @node: the current node being processed

Display the context of an error.

Definition at line 667 of file xsltutils.c.

668 {
669 int line = 0;
670 const xmlChar *file = NULL;
671 const xmlChar *name = NULL;
672 const char *type = "error";
674 void *errctx = xsltGenericErrorContext;
675
676 if (ctxt != NULL) {
677 if (ctxt->state == XSLT_STATE_OK)
678 ctxt->state = XSLT_STATE_ERROR;
679 if (ctxt->error != NULL) {
680 error = ctxt->error;
681 errctx = ctxt->errctx;
682 }
683 }
684 if ((node == NULL) && (ctxt != NULL))
685 node = ctxt->inst;
686
687 if (node != NULL) {
688 if ((node->type == XML_DOCUMENT_NODE) ||
689 (node->type == XML_HTML_DOCUMENT_NODE)) {
690 xmlDocPtr doc = (xmlDocPtr) node;
691
692 file = doc->URL;
693 } else {
694 line = xmlGetLineNo(node);
695 if ((node->doc != NULL) && (node->doc->URL != NULL))
696 file = node->doc->URL;
697 if (node->name != NULL)
698 name = node->name;
699 }
700 }
701
702 if (ctxt != NULL)
703 type = "runtime error";
704 else if (style != NULL) {
705#ifdef XSLT_REFACTORED
706 if (XSLT_CCTXT(style)->errSeverity == XSLT_ERROR_SEVERITY_WARNING)
707 type = "compilation warning";
708 else
709 type = "compilation error";
710#else
711 type = "compilation error";
712#endif
713 }
714
715 if ((file != NULL) && (line != 0) && (name != NULL))
716 error(errctx, "%s: file %s line %d element %s\n",
717 type, file, line, name);
718 else if ((file != NULL) && (name != NULL))
719 error(errctx, "%s: file %s element %s\n", type, file, name);
720 else if ((file != NULL) && (line != 0))
721 error(errctx, "%s: file %s line %d\n", type, file, line);
722 else if (file != NULL)
723 error(errctx, "%s: file %s\n", type, file);
724 else if (name != NULL)
725 error(errctx, "%s: element %s\n", type, name);
726 else
727 error(errctx, "%s\n", type);
728}
Definition: fci.c:127
Definition: parser.c:49
@ XSLT_STATE_ERROR
@ XSLT_STATE_OK

Referenced by xsltTransformError().

◆ xsltSaveResultTo()

XSLTPUBFUN int XSLTCALL xsltSaveResultTo ( xmlOutputBufferPtr  buf,
xmlDocPtr  result,
xsltStylesheetPtr  style 
)

xsltSaveResultTo: @buf: an output buffer

Returns
: the result xmlDocPtr @style: the stylesheet

Save the result

Returns
obtained by applying the @style stylesheet to an I/O output channel @buf

Returns the number of byte written or -1 in case of failure.

Definition at line 1564 of file xsltutils.c.

1565 {
1566 const xmlChar *encoding;
1567 int base;
1568 const xmlChar *method;
1569 int indent;
1570
1571 if ((buf == NULL) || (result == NULL) || (style == NULL))
1572 return(-1);
1573 if ((result->children == NULL) ||
1574 ((result->children->type == XML_DTD_NODE) &&
1575 (result->children->next == NULL)))
1576 return(0);
1577
1578 if ((style->methodURI != NULL) &&
1579 ((style->method == NULL) ||
1580 (!xmlStrEqual(style->method, (const xmlChar *) "xhtml")))) {
1582 "xsltSaveResultTo : unknown output method\n");
1583 return(-1);
1584 }
1585
1586 base = buf->written;
1587
1589 XSLT_GET_IMPORT_PTR(encoding, style, encoding)
1591
1592 if ((method == NULL) && (result->type == XML_HTML_DOCUMENT_NODE))
1593 method = (const xmlChar *) "html";
1594
1595 if ((method != NULL) &&
1596 (xmlStrEqual(method, (const xmlChar *) "html"))) {
1597 if (encoding != NULL) {
1598 htmlSetMetaEncoding(result, (const xmlChar *) encoding);
1599 } else {
1600 htmlSetMetaEncoding(result, (const xmlChar *) "UTF-8");
1601 }
1602 if (indent == -1)
1603 indent = 1;
1604 htmlDocContentDumpFormatOutput(buf, result, (const char *) encoding,
1605 indent);
1606 xmlOutputBufferFlush(buf);
1607 } else if ((method != NULL) &&
1608 (xmlStrEqual(method, (const xmlChar *) "xhtml"))) {
1609 if (encoding != NULL) {
1610 htmlSetMetaEncoding(result, (const xmlChar *) encoding);
1611 } else {
1612 htmlSetMetaEncoding(result, (const xmlChar *) "UTF-8");
1613 }
1614 htmlDocContentDumpOutput(buf, result, (const char *) encoding);
1615 xmlOutputBufferFlush(buf);
1616 } else if ((method != NULL) &&
1617 (xmlStrEqual(method, (const xmlChar *) "text"))) {
1618 xmlNodePtr cur;
1619
1620 cur = result->children;
1621 while (cur != NULL) {
1622 if (cur->type == XML_TEXT_NODE)
1623 xmlOutputBufferWriteString(buf, (const char *) cur->content);
1624
1625 /*
1626 * Skip to next node
1627 */
1628 if (cur->children != NULL) {
1629 if ((cur->children->type != XML_ENTITY_DECL) &&
1630 (cur->children->type != XML_ENTITY_REF_NODE) &&
1631 (cur->children->type != XML_ENTITY_NODE)) {
1632 cur = cur->children;
1633 continue;
1634 }
1635 }
1636 if (cur->next != NULL) {
1637 cur = cur->next;
1638 continue;
1639 }
1640
1641 do {
1642 cur = cur->parent;
1643 if (cur == NULL)
1644 break;
1645 if (cur == (xmlNodePtr) style->doc) {
1646 cur = NULL;
1647 break;
1648 }
1649 if (cur->next != NULL) {
1650 cur = cur->next;
1651 break;
1652 }
1653 } while (cur != NULL);
1654 }
1655 xmlOutputBufferFlush(buf);
1656 } else {
1657 int omitXmlDecl;
1658 int standalone;
1659
1660 XSLT_GET_IMPORT_INT(omitXmlDecl, style, omitXmlDeclaration);
1661 XSLT_GET_IMPORT_INT(standalone, style, standalone);
1662
1663 if (omitXmlDecl != 1) {
1664 xmlOutputBufferWriteString(buf, "<?xml version=");
1665 if (result->version != NULL) {
1666 xmlOutputBufferWriteString(buf, "\"");
1667 xmlOutputBufferWriteString(buf, (const char *)result->version);
1668 xmlOutputBufferWriteString(buf, "\"");
1669 } else
1670 xmlOutputBufferWriteString(buf, "\"1.0\"");
1671 if (encoding == NULL) {
1672 if (result->encoding != NULL)
1673 encoding = result->encoding;
1674 else if (result->charset != XML_CHAR_ENCODING_UTF8)
1675 encoding = (const xmlChar *)
1677 result->charset);
1678 }
1679 if (encoding != NULL) {
1680 xmlOutputBufferWriteString(buf, " encoding=");
1681 xmlOutputBufferWriteString(buf, "\"");
1682 xmlOutputBufferWriteString(buf, (const char *) encoding);
1683 xmlOutputBufferWriteString(buf, "\"");
1684 }
1685 switch (standalone) {
1686 case 0:
1687 xmlOutputBufferWriteString(buf, " standalone=\"no\"");
1688 break;
1689 case 1:
1690 xmlOutputBufferWriteString(buf, " standalone=\"yes\"");
1691 break;
1692 default:
1693 break;
1694 }
1695 xmlOutputBufferWriteString(buf, "?>\n");
1696 }
1697 if (result->children != NULL) {
1698 xmlNodePtr children = result->children;
1699 xmlNodePtr child = children;
1700
1701 /*
1702 * Hack to avoid quadratic behavior when scanning
1703 * result->children in xmlGetIntSubset called by
1704 * xmlNodeDumpOutput.
1705 */
1706 result->children = NULL;
1707
1708 while (child != NULL) {
1709 xmlNodeDumpOutput(buf, result, child, 0, (indent == 1),
1710 (const char *) encoding);
1711 if (indent && ((child->type == XML_DTD_NODE) ||
1712 ((child->type == XML_COMMENT_NODE) &&
1713 (child->next != NULL))))
1714 xmlOutputBufferWriteString(buf, "\n");
1715 child = child->next;
1716 }
1717 if (indent)
1718 xmlOutputBufferWriteString(buf, "\n");
1719
1720 result->children = children;
1721 }
1722 xmlOutputBufferFlush(buf);
1723 }
1724 return(buf->written - base);
1725}
static const WCHAR indent[]
Definition: object.c:1156
method
Definition: dragdrop.c:54
const char * xmlGetCharEncodingName(xmlCharEncoding enc)
Definition: encoding.c:1229
xmlCharEncoding
Definition: encoding.h:65
@ XML_CHAR_ENCODING_UTF8
Definition: encoding.h:68
FxCollectionEntry * cur
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint64EXT * result
Definition: glext.h:11304
static HWND child
Definition: cursoricon.c:298
#define XSLT_GET_IMPORT_INT(res, style, name)
Definition: node.c:1079
#define XSLT_GET_IMPORT_PTR(res, style, name)
Definition: node.c:1070

Referenced by xsltRunStylesheetUser(), xsltSaveResultToFd(), xsltSaveResultToFile(), xsltSaveResultToFilename(), and xsltSaveResultToString().

◆ xsltSaveResultToFd()

XSLTPUBFUN int XSLTCALL xsltSaveResultToFd ( int  fd,
xmlDocPtr  result,
xsltStylesheetPtr  style 
)

xsltSaveResultToFd: @fd: a file descriptor

Returns
: the result xmlDocPtr @style: the stylesheet

Save the result

Returns
obtained by applying the @style stylesheet to an open file descriptor This does not close the descriptor.

Returns the number of bytes written or -1 in case of failure.

Definition at line 1826 of file xsltutils.c.

1826 {
1827 xmlOutputBufferPtr buf;
1828 const xmlChar *encoding;
1829 int ret;
1830
1831 if ((fd < 0) || (result == NULL) || (style == NULL))
1832 return(-1);
1833 if (result->children == NULL)
1834 return(0);
1835
1836 XSLT_GET_IMPORT_PTR(encoding, style, encoding)
1837 if (encoding != NULL) {
1839
1840 /* Don't use UTF-8 dummy encoder */
1841 if ((xmlStrcasecmp(encoding, BAD_CAST "UTF-8") != 0) &&
1842 (xmlStrcasecmp(encoding, BAD_CAST "UTF8") != 0))
1843 encoder = xmlFindCharEncodingHandler((char *) encoding);
1844 buf = xmlOutputBufferCreateFd(fd, encoder);
1845 } else {
1846 buf = xmlOutputBufferCreateFd(fd, NULL);
1847 }
1848 if (buf == NULL)
1849 return(-1);
1851 ret = xmlOutputBufferClose(buf);
1852 return(ret);
1853}
xmlCharEncodingHandlerPtr xmlFindCharEncodingHandler(const char *name)
Definition: encoding.c:1677
static int fd
Definition: io.c:51
XMLPUBFUN int xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:277
int xsltSaveResultTo(xmlOutputBufferPtr buf, xmlDocPtr result, xsltStylesheetPtr style)
Definition: xsltutils.c:1564

◆ xsltSaveResultToFile()

XSLTPUBFUN int XSLTCALL xsltSaveResultToFile ( FILE file,
xmlDocPtr  result,
xsltStylesheetPtr  style 
)

Definition at line 1783 of file xsltutils.c.

1783 {
1784 xmlOutputBufferPtr buf;
1785 const xmlChar *encoding;
1786 int ret;
1787
1788 if ((file == NULL) || (result == NULL) || (style == NULL))
1789 return(-1);
1790 if (result->children == NULL)
1791 return(0);
1792
1793 XSLT_GET_IMPORT_PTR(encoding, style, encoding)
1794 if (encoding != NULL) {
1796
1797 /* Don't use UTF-8 dummy encoder */
1798 if ((xmlStrcasecmp(encoding, BAD_CAST "UTF-8") != 0) &&
1799 (xmlStrcasecmp(encoding, BAD_CAST "UTF8") != 0))
1800 encoder = xmlFindCharEncodingHandler((char *) encoding);
1801 buf = xmlOutputBufferCreateFile(file, encoder);
1802 } else {
1803 buf = xmlOutputBufferCreateFile(file, NULL);
1804 }
1805
1806 if (buf == NULL)
1807 return(-1);
1809 ret = xmlOutputBufferClose(buf);
1810 return(ret);
1811}

Referenced by xsltDocumentElem().

◆ xsltSaveResultToFilename()

XSLTPUBFUN int XSLTCALL xsltSaveResultToFilename ( const char URL,
xmlDocPtr  result,
xsltStylesheetPtr  style,
int  compression 
)

xsltSaveResultToFilename: @URL: a filename or URL

Returns
: the result xmlDocPtr @style: the stylesheet @compression: the compression factor (0 - 9 included)

Save the result

Returns
obtained by applying the @style stylesheet to a file or @URL

Returns the number of byte written or -1 in case of failure.

Definition at line 1740 of file xsltutils.c.

1741 {
1742 xmlOutputBufferPtr buf;
1743 const xmlChar *encoding;
1744 int ret;
1745
1746 if ((URL == NULL) || (result == NULL) || (style == NULL))
1747 return(-1);
1748 if (result->children == NULL)
1749 return(0);
1750
1751 XSLT_GET_IMPORT_PTR(encoding, style, encoding)
1752 if (encoding != NULL) {
1754
1755 /* Don't use UTF-8 dummy encoder */
1756 if ((xmlStrcasecmp(encoding, BAD_CAST "UTF-8") != 0) &&
1757 (xmlStrcasecmp(encoding, BAD_CAST "UTF8") != 0))
1758 encoder = xmlFindCharEncodingHandler((char *) encoding);
1759 buf = xmlOutputBufferCreateFilename(URL, encoder, compression);
1760 } else {
1761 buf = xmlOutputBufferCreateFilename(URL, NULL, compression);
1762 }
1763 if (buf == NULL)
1764 return(-1);
1766 ret = xmlOutputBufferClose(buf);
1767 return(ret);
1768}
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY _In_ uint8_t compression
Definition: btrfs_drv.h:1365

Referenced by xsltDocumentElem(), and xsltRunStylesheetUser().

◆ xsltSaveResultToString()

XSLTPUBFUN int XSLTCALL xsltSaveResultToString ( xmlChar **  doc_txt_ptr,
int doc_txt_len,
xmlDocPtr  result,
xsltStylesheetPtr  style 
)

xsltSaveResultToString: @doc_txt_ptr: Memory pointer for allocated XML text @doc_txt_len: Length of the generated XML text

Returns
: the result xmlDocPtr @style: the stylesheet

Save the result

Returns
obtained by applying the @style stylesheet to a new allocated string.

Returns 0 in case of success and -1 in case of error

Definition at line 1868 of file xsltutils.c.

1869 {
1870 xmlOutputBufferPtr buf;
1871 const xmlChar *encoding;
1872
1873 *doc_txt_ptr = NULL;
1874 *doc_txt_len = 0;
1875 if (result->children == NULL)
1876 return(0);
1877
1878 XSLT_GET_IMPORT_PTR(encoding, style, encoding)
1879 if (encoding != NULL) {
1881
1882 /* Don't use UTF-8 dummy encoder */
1883 if ((xmlStrcasecmp(encoding, BAD_CAST "UTF-8") != 0) &&
1884 (xmlStrcasecmp(encoding, BAD_CAST "UTF8") != 0))
1885 encoder = xmlFindCharEncodingHandler((char *) encoding);
1886 buf = xmlAllocOutputBuffer(encoder);
1887 if (buf == NULL)
1889 } else {
1890 buf = xmlAllocOutputBuffer(NULL);
1891 }
1892 if (buf == NULL)
1893 return(-1);
1895#ifdef LIBXML2_NEW_BUFFER
1896 if (buf->conv != NULL) {
1897 *doc_txt_len = xmlBufUse(buf->conv);
1898 *doc_txt_ptr = xmlStrndup(xmlBufContent(buf->conv), *doc_txt_len);
1899 } else {
1900 *doc_txt_len = xmlBufUse(buf->buffer);
1901 *doc_txt_ptr = xmlStrndup(xmlBufContent(buf->buffer), *doc_txt_len);
1902 }
1903#else
1904 if (buf->conv != NULL) {
1905 *doc_txt_len = buf->conv->use;
1906 *doc_txt_ptr = xmlStrndup(buf->conv->content, *doc_txt_len);
1907 } else {
1908 *doc_txt_len = buf->buffer->use;
1909 *doc_txt_ptr = xmlStrndup(buf->buffer->content, *doc_txt_len);
1910 }
1911#endif
1912 (void)xmlOutputBufferClose(buf);
1913 return 0;
1914}
xmlChar * xmlBufContent(const xmlBuf *buf)
Definition: buf.c:490
size_t xmlBufUse(const xmlBufPtr buf)
Definition: buf.c:570
XMLPUBFUN int xmlCharEncCloseFunc(xmlCharEncodingHandler *handler)

◆ xsltSetCtxtLocaleHandlers()

XSLTPUBFUN void XSLTCALL xsltSetCtxtLocaleHandlers ( xsltTransformContextPtr  ctxt,
xsltNewLocaleFunc  newLocale,
xsltFreeLocaleFunc  freeLocale,
xsltGenSortKeyFunc  genSortKey 
)

xsltSetCtxtLocaleHandlers: @ctxt: an XSLT transform context @newLocale: locale constructor @freeLocale: locale destructor @genSortKey: sort key generator

Set the locale handlers.

Definition at line 1500 of file xsltutils.c.

1503 {
1504 if (ctxt == NULL)
1505 return;
1506
1507 ctxt->newLocale = newLocale;
1508 ctxt->freeLocale = freeLocale;
1509 ctxt->genSortKey = genSortKey;
1510}
xsltGenSortKeyFunc genSortKey

◆ xsltSetCtxtParseOptions()

XSLTPUBFUN void XSLTCALL XSLTPUBFUN int XSLTCALL xsltSetCtxtParseOptions ( xsltTransformContextPtr  ctxt,
int  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 parser when using document() loading.

Returns the previous options or -1 in case of error

Definition at line 1529 of file xsltutils.c.

1530{
1531 int oldopts;
1532
1533 if (ctxt == NULL)
1534 return(-1);
1535 oldopts = ctxt->parserOptions;
1536 if (ctxt->xinclude)
1537 oldopts |= XML_PARSE_XINCLUDE;
1538 ctxt->parserOptions = options;
1540 ctxt->xinclude = 1;
1541 else
1542 ctxt->xinclude = 0;
1543 return(oldopts);
1544}
@ XML_PARSE_XINCLUDE
Definition: parser.h:1240

◆ xsltSetCtxtSortFunc()

XSLTPUBFUN void XSLTCALL xsltSetCtxtSortFunc ( xsltTransformContextPtr  ctxt,
xsltSortFunc  handler 
)

xsltSetCtxtSortFunc: @ctxt: a XSLT process context @handler: the new handler function

DEPRECATED: Use xsltSetCtxtLocaleHandlers.

Function to set the handler for XSLT sorting for the specified context. If the handler is NULL, then the global sort function will be called

Definition at line 1486 of file xsltutils.c.

1486 {
1487 ctxt->sortfunc = handler;
1488}
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7512

◆ xsltSetGenericDebugFunc()

XSLTPUBFUN void XSLTCALL xsltSetGenericDebugFunc ( void ctx,
xmlGenericErrorFunc  handler 
)

xsltSetGenericDebugFunc: @ctx: the new error handling context @handler: the new handler function

Function to reset the handler and the error context for out of context error messages. This simply means that @handler will be called for subsequent error messages while not parsing or validating. And @ctx will be passed as first argument to @handler One can simply force messages to be emitted to another FILE * than stderr by setting @ctx to this file handle and @handler to NULL.

Definition at line 650 of file xsltutils.c.

650 {
652 if (handler != NULL)
654 else
655 xsltGenericDebug = xsltGenericDebugDefaultFunc;
656}
xmlGenericErrorFunc xsltGenericDebug
Definition: xsltutils.c:632
void * xsltGenericDebugContext
Definition: xsltutils.c:633

◆ xsltSetGenericErrorFunc()

XSLTPUBFUN void XSLTCALL xsltSetGenericErrorFunc ( void ctx,
xmlGenericErrorFunc  handler 
)

xsltSetGenericErrorFunc: @ctx: the new error handling context @handler: the new handler function

Function to reset the handler and the error context for out of context error messages. This simply means that @handler will be called for subsequent error messages while not parsing nor validating. And @ctx will be passed as first argument to @handler One can simply force messages to be emitted to another FILE * than stderr by setting @ctx to this file handle and @handler to NULL.

Definition at line 604 of file xsltutils.c.

604 {
606 if (handler != NULL)
608 else
609 xsltGenericError = xsltGenericErrorDefaultFunc;
610}

◆ xsltSetSortFunc()

XSLTPUBFUN void XSLTCALL xsltSetSortFunc ( xsltSortFunc  handler)

xsltSetSortFunc: @handler: the new handler function

DEPRECATED: Use xsltSetCtxtLocaleHandlers.

Function to reset the global handler for XSLT sorting. If the handler is NULL, the default sort function will be used.

Definition at line 1466 of file xsltutils.c.

1466 {
1467 if (handler != NULL)
1469 else
1471}
void xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts, int nbsorts)
Definition: xsltutils.c:1181

◆ xsltSetTransformErrorFunc()

XSLTPUBFUN void XSLTCALL xsltSetTransformErrorFunc ( xsltTransformContextPtr  ctxt,
void ctx,
xmlGenericErrorFunc  handler 
)

xsltSetTransformErrorFunc: @ctxt: the XSLT transformation context @ctx: the new error handling context @handler: the new handler function

Function to reset the handler and the error context for out of context error messages specific to a given XSLT transromation.

This simply means that @handler will be called for subsequent error messages while running the transformation.

Definition at line 743 of file xsltutils.c.

745{
746 ctxt->error = handler;
747 ctxt->errctx = ctx;
748}

◆ xsltSplitQName()

XSLTPUBFUN const xmlChar *XSLTCALL xsltSplitQName ( xmlDictPtr  dict,
const xmlChar name,
const xmlChar **  prefix 
)

Definition at line 804 of file xsltutils.c.

804 {
805 int len = 0;
806 const xmlChar *ret = NULL;
807
808 *prefix = NULL;
809 if ((name == NULL) || (dict == NULL)) return(NULL);
810 if (name[0] == ':')
811 return(xmlDictLookup(dict, name, -1));
812 while ((name[len] != 0) && (name[len] != ':')) len++;
813 if (name[len] == 0) return(xmlDictLookup(dict, name, -1));
814 *prefix = xmlDictLookup(dict, name, len);
815 ret = xmlDictLookup(dict, &name[len + 1], -1);
816 return(ret);
817}
Character const *const prefix
Definition: tempnam.cpp:195

Referenced by xsltApplyAttributeSet(), xsltAttribute(), xsltAttributeComp(), xsltElement(), xsltElementComp(), xsltFormatNumberFunction(), xsltParseStylesheetAttributeSet(), and xsltProcessUserParamInternal().

◆ xsltTransformError()

XSLTPUBFUN void XSLTCALL xsltTransformError ( xsltTransformContextPtr  ctxt,
xsltStylesheetPtr  style,
xmlNodePtr  node,
const char msg,
  ... 
)

◆ xsltXPathCompile()

XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL xsltXPathCompile ( xsltStylesheetPtr  style,
const xmlChar str 
)

xsltXPathCompile: @style: the stylesheet @str: the XPath expression

Compile an XPath expression

Returns the xmlXPathCompExprPtr resulting from the compilation or NULL. the caller has to free the object.

Definition at line 2593 of file xsltutils.c.

2593 {
2594 return(xsltXPathCompileFlags(style, str, 0));
2595}
const WCHAR * str
xmlXPathCompExprPtr xsltXPathCompileFlags(xsltStylesheetPtr style, const xmlChar *str, int flags)
Definition: xsltutils.c:2550

Referenced by xsltAddKey(), xsltApplyTemplatesComp(), xsltCompileAttr(), xsltCopyOfComp(), xsltForEachComp(), xsltIfComp(), xsltParamComp(), xsltSortComp(), xsltValueOfComp(), xsltVariableComp(), xsltWhenComp(), and xsltWithParamComp().

◆ xsltXPathCompileFlags()

XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL xsltXPathCompileFlags ( xsltStylesheetPtr  style,
const xmlChar str,
int  flags 
)

xsltXPathCompileFlags: @style: the stylesheet @str: the XPath expression @flags: extra compilation flags to pass down to libxml2 XPath

Compile an XPath expression

Returns the xmlXPathCompExprPtr resulting from the compilation or NULL. the caller has to free the object.

Definition at line 2550 of file xsltutils.c.

2550 {
2551 xmlXPathContextPtr xpathCtxt;
2552 xmlXPathCompExprPtr ret;
2553
2554 if (style != NULL) {
2555 xpathCtxt = style->principal->xpathCtxt;
2556 if (xpathCtxt == NULL)
2557 return NULL;
2558 xpathCtxt->dict = style->dict;
2559 } else {
2560 xpathCtxt = xmlXPathNewContext(NULL);
2561 if (xpathCtxt == NULL)
2562 return NULL;
2563 }
2564 xpathCtxt->flags = flags;
2565
2566 /*
2567 * Compile the expression.
2568 */
2569 ret = xmlXPathCtxtCompile(xpathCtxt, str);
2570
2571 if (style == NULL) {
2572 xmlXPathFreeContext(xpathCtxt);
2573 }
2574 /*
2575 * TODO: there is a lot of optimizations which should be possible
2576 * like variable slot precomputations, function precomputations, etc.
2577 */
2578
2579 return(ret);
2580}
GLbitfield flags
Definition: glext.h:7161

Referenced by xsltAddKey(), xsltCompMatchAdd(), and xsltXPathCompile().

Variable Documentation

◆ xslDebugStatus

XSLTPUBVAR int xslDebugStatus

Definition at line 316 of file xsltutils.h.

◆ xsltGenericDebug

XSLTPUBVAR xmlGenericErrorFunc xsltGenericDebug

Definition at line 146 of file xsltutils.h.

◆ xsltGenericDebugContext

XSLTPUBVAR void* xsltGenericDebugContext

Definition at line 147 of file xsltutils.h.

◆ xsltGenericError

XSLTPUBVAR xmlGenericErrorFunc xsltGenericError

Definition at line 144 of file xsltutils.h.

◆ xsltGenericErrorContext

XSLTPUBVAR void* xsltGenericErrorContext

Definition at line 145 of file xsltutils.h.