ReactOS  0.4.13-dev-1158-g658d5a3
pattern.h File Reference
#include "xsltInternals.h"
#include "xsltexports.h"
Include dependency graph for pattern.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct _xsltCompMatch xsltCompMatch
 
typedef xsltCompMatchxsltCompMatchPtr
 

Functions

XSLTPUBFUN xsltCompMatchPtr XSLTCALL xsltCompilePattern (const xmlChar *pattern, xmlDocPtr doc, xmlNodePtr node, xsltStylesheetPtr style, xsltTransformContextPtr runtime)
 
XSLTPUBFUN void XSLTCALL xsltFreeCompMatchList (xsltCompMatchPtr comp)
 
XSLTPUBFUN int XSLTCALL xsltTestCompMatchList (xsltTransformContextPtr ctxt, xmlNodePtr node, xsltCompMatchPtr comp)
 
XSLTPUBFUN void XSLTCALL xsltNormalizeCompSteps (void *payload, void *data, const xmlChar *name)
 
XSLTPUBFUN int XSLTCALL xsltAddTemplate (xsltStylesheetPtr style, xsltTemplatePtr cur, const xmlChar *mode, const xmlChar *modeURI)
 
XSLTPUBFUN xsltTemplatePtr XSLTCALL xsltGetTemplate (xsltTransformContextPtr ctxt, xmlNodePtr node, xsltStylesheetPtr style)
 
XSLTPUBFUN void XSLTCALL xsltFreeTemplateHashes (xsltStylesheetPtr style)
 
XSLTPUBFUN void XSLTCALL xsltCleanupTemplates (xsltStylesheetPtr style)
 

Typedef Documentation

◆ xsltCompMatch

xsltCompMatch:

Data structure used for the implementation of patterns. It is kept private (in pattern.c).

Definition at line 28 of file pattern.h.

◆ xsltCompMatchPtr

Definition at line 29 of file pattern.h.

Function Documentation

◆ xsltAddTemplate()

XSLTPUBFUN int XSLTCALL xsltAddTemplate ( xsltStylesheetPtr  style,
xsltTemplatePtr  cur,
const xmlChar mode,
const xmlChar modeURI 
)

xsltAddTemplate: @style: an XSLT stylesheet @cur: an XSLT template @mode: the mode name or NULL @modeURI: the mode URI or NULL

Register the XSLT pattern associated to @cur

Returns -1 in case of error, 0 otherwise

Definition at line 2085 of file pattern.c.

2086  {
2087  xsltCompMatchPtr pat, list, next;
2088  /*
2089  * 'top' will point to style->xxxMatch ptr - declaring as 'void'
2090  * avoids gcc 'type-punned pointer' warning.
2091  */
2092  void **top = NULL;
2093  const xmlChar *name = NULL;
2094  float priority; /* the priority */
2095 
2096  if ((style == NULL) || (cur == NULL))
2097  return(-1);
2098 
2099  /* Register named template */
2100  if (cur->name != NULL) {
2101  if (style->namedTemplates == NULL) {
2102  style->namedTemplates = xmlHashCreate(10);
2103  if (style->namedTemplates == NULL)
2104  return(-1);
2105  }
2106  else {
2107  void *dup = xmlHashLookup2(style->namedTemplates, cur->name,
2108  cur->nameURI);
2109  if (dup != NULL) {
2111  "xsl:template: error duplicate name '%s'\n",
2112  cur->name);
2113  style->errors++;
2114  return(-1);
2115  }
2116  }
2117 
2118  xmlHashAddEntry2(style->namedTemplates, cur->name, cur->nameURI, cur);
2119  }
2120 
2121  if (cur->match == NULL)
2122  return(0);
2123 
2124  priority = cur->priority;
2125  pat = xsltCompilePatternInternal(cur->match, style->doc, cur->elem,
2126  style, NULL, 1);
2127  if (pat == NULL)
2128  return(-1);
2129  while (pat) {
2130  next = pat->next;
2131  pat->next = NULL;
2132  name = NULL;
2133 
2134  pat->template = cur;
2135  if (mode != NULL)
2136  pat->mode = xmlDictLookup(style->dict, mode, -1);
2137  if (modeURI != NULL)
2138  pat->modeURI = xmlDictLookup(style->dict, modeURI, -1);
2140  pat->priority = priority;
2141 
2142  /*
2143  * insert it in the hash table list corresponding to its lookup name
2144  */
2145  switch (pat->steps[0].op) {
2146  case XSLT_OP_ATTR:
2147  if (pat->steps[0].value != NULL)
2148  name = pat->steps[0].value;
2149  else
2150  top = &(style->attrMatch);
2151  break;
2152  case XSLT_OP_PARENT:
2153  case XSLT_OP_ANCESTOR:
2154  top = &(style->elemMatch);
2155  break;
2156  case XSLT_OP_ROOT:
2157  top = &(style->rootMatch);
2158  break;
2159  case XSLT_OP_KEY:
2160  top = &(style->keyMatch);
2161  break;
2162  case XSLT_OP_ID:
2163  /* TODO optimize ID !!! */
2164  case XSLT_OP_NS:
2165  case XSLT_OP_ALL:
2166  top = &(style->elemMatch);
2167  break;
2168  case XSLT_OP_END:
2169  case XSLT_OP_PREDICATE:
2171  "xsltAddTemplate: invalid compiled pattern\n");
2172  xsltFreeCompMatch(pat);
2173  return(-1);
2174  /*
2175  * TODO: some flags at the top level about type based patterns
2176  * would be faster than inclusion in the hash table.
2177  */
2178  case XSLT_OP_PI:
2179  if (pat->steps[0].value != NULL)
2180  name = pat->steps[0].value;
2181  else
2182  top = &(style->piMatch);
2183  break;
2184  case XSLT_OP_COMMENT:
2185  top = &(style->commentMatch);
2186  break;
2187  case XSLT_OP_TEXT:
2188  top = &(style->textMatch);
2189  break;
2190  case XSLT_OP_ELEM:
2191  case XSLT_OP_NODE:
2192  if (pat->steps[0].value != NULL)
2193  name = pat->steps[0].value;
2194  else
2195  top = &(style->elemMatch);
2196  break;
2197  }
2198  if (name != NULL) {
2199  if (style->templatesHash == NULL) {
2200  style->templatesHash = xmlHashCreate(1024);
2201  if (style->templatesHash == NULL) {
2202  xsltFreeCompMatch(pat);
2203  return(-1);
2204  }
2205  xmlHashAddEntry3(style->templatesHash, name, mode, modeURI, pat);
2206  } else {
2207  list = (xsltCompMatchPtr) xmlHashLookup3(style->templatesHash,
2208  name, mode, modeURI);
2209  if (list == NULL) {
2210  xmlHashAddEntry3(style->templatesHash, name,
2211  mode, modeURI, pat);
2212  } else {
2213  /*
2214  * Note '<=' since one must choose among the matching
2215  * template rules that are left, the one that occurs
2216  * last in the stylesheet
2217  */
2218  if (list->priority <= pat->priority) {
2219  pat->next = list;
2220  xmlHashUpdateEntry3(style->templatesHash, name,
2221  mode, modeURI, pat, NULL);
2222  } else {
2223  while (list->next != NULL) {
2224  if (list->next->priority <= pat->priority)
2225  break;
2226  list = list->next;
2227  }
2228  pat->next = list->next;
2229  list->next = pat;
2230  }
2231  }
2232  }
2233  } else if (top != NULL) {
2234  list = *top;
2235  if (list == NULL) {
2236  *top = pat;
2237  pat->next = NULL;
2238  } else if (list->priority <= pat->priority) {
2239  pat->next = list;
2240  *top = pat;
2241  } else {
2242  while (list->next != NULL) {
2243  if (list->next->priority <= pat->priority)
2244  break;
2245  list = list->next;
2246  }
2247  pat->next = list->next;
2248  list->next = pat;
2249  }
2250  } else {
2252  "xsltAddTemplate: invalid compiled pattern\n");
2253  xsltFreeCompMatch(pat);
2254  return(-1);
2255  }
2256 #ifdef WITH_XSLT_DEBUG_PATTERN
2257  if (mode)
2259  "added pattern : '%s' mode '%s' priority %f\n",
2260  pat->pattern, pat->mode, pat->priority);
2261  else
2263  "added pattern : '%s' priority %f\n",
2264  pat->pattern, pat->priority);
2265 #endif
2266 
2267  pat = next;
2268  }
2269  return(0);
2270 }
XMLPUBFUN int XMLCALL xmlHashAddEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata)
Definition: hash.c:529
const xmlChar * name
xsltOp op
Definition: pattern.c:68
XMLPUBFUN int XMLCALL xmlHashAddEntry2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, void *userdata)
Definition: hash.c:404
#define XSLT_PAT_NO_PRIORITY
const xmlChar * mode
Definition: pattern.c:85
xmlNodePtr elem
static void xsltFreeCompMatch(xsltCompMatchPtr comp)
Definition: pattern.c:160
XMLPUBFUN void *XMLCALL xmlHashLookup2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2)
Definition: hash.c:474
const xmlChar * nameURI
smooth NULL
Definition: ftsmooth.c:416
xmlChar * value
Definition: pattern.c:69
struct _xsltCompMatch * next
Definition: pattern.c:82
XMLPUBFUN void *XMLCALL xmlHashLookup3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3)
Definition: hash.c:767
const xmlChar * modeURI
Definition: pattern.c:86
void * xsltGenericDebugContext
Definition: xsltutils.c:549
static xsltCompMatchPtr xsltCompilePatternInternal(const xmlChar *pattern, xmlDocPtr doc, xmlNodePtr node, xsltStylesheetPtr style, xsltTransformContextPtr runtime, int novar)
Definition: pattern.c:1884
struct list * next
Definition: list.h:38
XMLPUBFUN const xmlChar *XMLCALL xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len)
Definition: dict.c:858
float priority
Definition: pattern.c:83
xmlGenericErrorFunc xsltGenericDebug
Definition: xsltutils.c:548
const xmlChar * pattern
Definition: pattern.c:84
xsltCompMatch * xsltCompMatchPtr
Definition: pattern.h:29
XMLPUBFUN xmlHashTablePtr XMLCALL xmlHashCreate(int size)
Definition: hash.c:174
XMLPUBFUN int XMLCALL xmlHashUpdateEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata, xmlHashDeallocator f)
Definition: hash.c:645
xsltStepOpPtr steps
Definition: pattern.c:96
unsigned char xmlChar
Definition: xmlstring.h:28
Definition: _list.h:228
GLenum mode
Definition: glext.h:6217
static unsigned __int64 next
Definition: rand_nt.c:6
#define list
Definition: rosglue.h:35
Definition: name.c:36
_Check_return_ _CRTIMP int __cdecl dup(_In_ int _FileHandle)
static int priority
Definition: timer.c:163
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
xsltTemplatePtr template
Definition: pattern.c:87
xmlChar * match
void xsltTransformError(xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node, const char *msg,...)
Definition: xsltutils.c:678
Arabic default style
Definition: afstyles.h:93

Referenced by xsltParseStylesheetProcess(), and xsltParseStylesheetTemplate().

◆ xsltCleanupTemplates()

XSLTPUBFUN void XSLTCALL xsltCleanupTemplates ( xsltStylesheetPtr style  ATTRIBUTE_UNUSED)

xsltCleanupTemplates: @style: an XSLT stylesheet

Cleanup the state of the templates used by the stylesheet and the ones it imports.

Definition at line 2563 of file pattern.c.

2563  {
2564 }

Referenced by xsltApplyStylesheetInternal().

◆ xsltCompilePattern()

XSLTPUBFUN xsltCompMatchPtr XSLTCALL xsltCompilePattern ( const xmlChar pattern,
xmlDocPtr  doc,
xmlNodePtr  node,
xsltStylesheetPtr  style,
xsltTransformContextPtr  runtime 
)

xsltCompilePattern: @pattern: an XSLT pattern @doc: the containing document @node: the containing element @style: the stylesheet @runtime: the transformation context, if done at run-time

Compile the XSLT pattern and generates a list of precompiled form suitable for fast matching.

[1] Pattern ::= LocationPathPattern | Pattern '|' LocationPathPattern

Returns the generated pattern list or NULL in case of failure

Definition at line 2061 of file pattern.c.

2063  {
2064  return (xsltCompilePatternInternal(pattern, doc, node, style, runtime, 0));
2065 }
static xsltCompMatchPtr xsltCompilePatternInternal(const xmlChar *pattern, xmlDocPtr doc, xmlNodePtr node, xsltStylesheetPtr style, xsltTransformContextPtr runtime, int novar)
Definition: pattern.c:1884
Arabic default style
Definition: afstyles.h:93
GLubyte * pattern
Definition: glext.h:7787
Definition: dlist.c:348

Referenced by xsltNumberComp().

◆ xsltFreeCompMatchList()

XSLTPUBFUN void XSLTCALL xsltFreeCompMatchList ( xsltCompMatchPtr  comp)

xsltFreeCompMatchList: @comp: an XSLT comp list

Free up the memory allocated by all the elements of @comp

Definition at line 193 of file pattern.c.

193  {
194  xsltCompMatchPtr cur;
195 
196  while (comp != NULL) {
197  cur = comp;
198  comp = comp->next;
199  xsltFreeCompMatch(cur);
200  }
201 }
static void xsltFreeCompMatch(xsltCompMatchPtr comp)
Definition: pattern.c:160
smooth NULL
Definition: ftsmooth.c:416
struct _xsltCompMatch * next
Definition: pattern.c:82

Referenced by xsltCompilePatternInternal(), xsltFreeCompMatchListEntry(), xsltFreeStylePreComp(), and xsltFreeTemplateHashes().

◆ xsltFreeTemplateHashes()

XSLTPUBFUN void XSLTCALL xsltFreeTemplateHashes ( xsltStylesheetPtr  style)

xsltFreeTemplateHashes: @style: an XSLT stylesheet

Free up the memory used by xsltAddTemplate/xsltGetTemplate mechanism

Definition at line 2573 of file pattern.c.

2573  {
2574  if (style->templatesHash != NULL)
2575  xmlHashFree((xmlHashTablePtr) style->templatesHash,
2577  if (style->rootMatch != NULL)
2578  xsltFreeCompMatchList(style->rootMatch);
2579  if (style->keyMatch != NULL)
2580  xsltFreeCompMatchList(style->keyMatch);
2581  if (style->elemMatch != NULL)
2582  xsltFreeCompMatchList(style->elemMatch);
2583  if (style->attrMatch != NULL)
2584  xsltFreeCompMatchList(style->attrMatch);
2585  if (style->parentMatch != NULL)
2586  xsltFreeCompMatchList(style->parentMatch);
2587  if (style->textMatch != NULL)
2588  xsltFreeCompMatchList(style->textMatch);
2589  if (style->piMatch != NULL)
2590  xsltFreeCompMatchList(style->piMatch);
2591  if (style->commentMatch != NULL)
2592  xsltFreeCompMatchList(style->commentMatch);
2593  if (style->namedTemplates != NULL)
2594  xmlHashFree(style->namedTemplates, NULL);
2595 }
void xsltFreeCompMatchList(xsltCompMatchPtr comp)
Definition: pattern.c:193
XMLPUBFUN void XMLCALL xmlHashFree(xmlHashTablePtr table, xmlHashDeallocator f)
Definition: hash.c:320
smooth NULL
Definition: ftsmooth.c:416
static void xsltFreeCompMatchListEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED)
Definition: pattern.c:204
Arabic default style
Definition: afstyles.h:93

Referenced by xsltFreeStylesheet().

◆ xsltGetTemplate()

xsltGetTemplate: @ctxt: a XSLT process context @node: the node being processed @style: the current style

Finds the template applying to this node, if @style is non-NULL it means one needs to look for the next imported template in scope.

Returns the xsltTemplatePtr or NULL if not found

Definition at line 2318 of file pattern.c.

2320 {
2321  xsltStylesheetPtr curstyle;
2323  const xmlChar *name = NULL;
2325  float priority;
2326  int keyed = 0;
2327 
2328  if ((ctxt == NULL) || (node == NULL))
2329  return(NULL);
2330 
2331  if (style == NULL) {
2332  curstyle = ctxt->style;
2333  } else {
2334  curstyle = xsltNextImport(style);
2335  }
2336 
2337  while ((curstyle != NULL) && (curstyle != style)) {
2339  /* TODO : handle IDs/keys here ! */
2340  if (curstyle->templatesHash != NULL) {
2341  /*
2342  * Use the top name as selector
2343  */
2344  switch (node->type) {
2345  case XML_ELEMENT_NODE:
2346  if (node->name[0] == ' ')
2347  break;
2348  case XML_ATTRIBUTE_NODE:
2349  case XML_PI_NODE:
2350  name = node->name;
2351  break;
2352  case XML_DOCUMENT_NODE:
2354  case XML_TEXT_NODE:
2356  case XML_COMMENT_NODE:
2357  case XML_ENTITY_REF_NODE:
2358  case XML_ENTITY_NODE:
2361  case XML_NOTATION_NODE:
2362  case XML_DTD_NODE:
2363  case XML_ELEMENT_DECL:
2364  case XML_ATTRIBUTE_DECL:
2365  case XML_ENTITY_DECL:
2366  case XML_NAMESPACE_DECL:
2367  case XML_XINCLUDE_START:
2368  case XML_XINCLUDE_END:
2369  break;
2370  default:
2371  return(NULL);
2372 
2373  }
2374  }
2375  if (name != NULL) {
2376  /*
2377  * find the list of applicable expressions based on the name
2378  */
2380  name, ctxt->mode, ctxt->modeURI);
2381  } else
2382  list = NULL;
2383  while (list != NULL) {
2384  if (xsltTestCompMatch(ctxt, list, node,
2385  ctxt->mode, ctxt->modeURI)) {
2386  ret = list->template;
2387  priority = list->priority;
2388  break;
2389  }
2390  list = list->next;
2391  }
2392  list = NULL;
2393 
2394  /*
2395  * find alternate generic matches
2396  */
2397  switch (node->type) {
2398  case XML_ELEMENT_NODE:
2399  if (node->name[0] == ' ')
2400  list = curstyle->rootMatch;
2401  else
2402  list = curstyle->elemMatch;
2403  if (node->psvi != NULL) keyed = 1;
2404  break;
2405  case XML_ATTRIBUTE_NODE: {
2406  xmlAttrPtr attr;
2407 
2408  list = curstyle->attrMatch;
2409  attr = (xmlAttrPtr) node;
2410  if (attr->psvi != NULL) keyed = 1;
2411  break;
2412  }
2413  case XML_PI_NODE:
2414  list = curstyle->piMatch;
2415  if (node->psvi != NULL) keyed = 1;
2416  break;
2417  case XML_DOCUMENT_NODE:
2418  case XML_HTML_DOCUMENT_NODE: {
2419  xmlDocPtr doc;
2420 
2421  list = curstyle->rootMatch;
2422  doc = (xmlDocPtr) node;
2423  if (doc->psvi != NULL) keyed = 1;
2424  break;
2425  }
2426  case XML_TEXT_NODE:
2428  list = curstyle->textMatch;
2429  if (node->psvi != NULL) keyed = 1;
2430  break;
2431  case XML_COMMENT_NODE:
2432  list = curstyle->commentMatch;
2433  if (node->psvi != NULL) keyed = 1;
2434  break;
2435  case XML_ENTITY_REF_NODE:
2436  case XML_ENTITY_NODE:
2439  case XML_NOTATION_NODE:
2440  case XML_DTD_NODE:
2441  case XML_ELEMENT_DECL:
2442  case XML_ATTRIBUTE_DECL:
2443  case XML_ENTITY_DECL:
2444  case XML_NAMESPACE_DECL:
2445  case XML_XINCLUDE_START:
2446  case XML_XINCLUDE_END:
2447  break;
2448  default:
2449  break;
2450  }
2451  while ((list != NULL) &&
2452  ((ret == NULL) || (list->priority > priority))) {
2453  if (xsltTestCompMatch(ctxt, list, node,
2454  ctxt->mode, ctxt->modeURI)) {
2455  ret = list->template;
2456  priority = list->priority;
2457  break;
2458  }
2459  list = list->next;
2460  }
2461  /*
2462  * Some of the tests for elements can also apply to documents
2463  */
2464  if ((node->type == XML_DOCUMENT_NODE) ||
2465  (node->type == XML_HTML_DOCUMENT_NODE) ||
2466  (node->type == XML_TEXT_NODE)) {
2467  list = curstyle->elemMatch;
2468  while ((list != NULL) &&
2469  ((ret == NULL) || (list->priority > priority))) {
2470  if (xsltTestCompMatch(ctxt, list, node,
2471  ctxt->mode, ctxt->modeURI)) {
2472  ret = list->template;
2473  priority = list->priority;
2474  break;
2475  }
2476  list = list->next;
2477  }
2478  } else if ((node->type == XML_PI_NODE) ||
2479  (node->type == XML_COMMENT_NODE)) {
2480  list = curstyle->elemMatch;
2481  while ((list != NULL) &&
2482  ((ret == NULL) || (list->priority > priority))) {
2483  if (xsltTestCompMatch(ctxt, list, node,
2484  ctxt->mode, ctxt->modeURI)) {
2485  ret = list->template;
2486  priority = list->priority;
2487  break;
2488  }
2489  list = list->next;
2490  }
2491  }
2492 
2493 keyed_match:
2494  if (keyed) {
2495  list = curstyle->keyMatch;
2496  while ((list != NULL) &&
2497  ((ret == NULL) || (list->priority > priority))) {
2498  if (xsltTestCompMatch(ctxt, list, node,
2499  ctxt->mode, ctxt->modeURI)) {
2500  ret = list->template;
2501  priority = list->priority;
2502  break;
2503  }
2504  list = list->next;
2505  }
2506  }
2507  else if (ctxt->hasTemplKeyPatterns &&
2508  ((ctxt->document == NULL) ||
2509  (ctxt->document->nbKeysComputed < ctxt->nbKeys)))
2510  {
2511  /*
2512  * Compute all remaining keys for this document.
2513  *
2514  * REVISIT TODO: I think this could be further optimized.
2515  */
2516  if (xsltComputeAllKeys(ctxt, node) == -1)
2517  goto error;
2518 
2519  switch (node->type) {
2520  case XML_ELEMENT_NODE:
2521  if (node->psvi != NULL) keyed = 1;
2522  break;
2523  case XML_ATTRIBUTE_NODE:
2524  if (((xmlAttrPtr) node)->psvi != NULL) keyed = 1;
2525  break;
2526  case XML_TEXT_NODE:
2528  case XML_COMMENT_NODE:
2529  case XML_PI_NODE:
2530  if (node->psvi != NULL) keyed = 1;
2531  break;
2532  case XML_DOCUMENT_NODE:
2534  if (((xmlDocPtr) node)->psvi != NULL) keyed = 1;
2535  break;
2536  default:
2537  break;
2538  }
2539  if (keyed)
2540  goto keyed_match;
2541  }
2542  if (ret != NULL)
2543  return(ret);
2544 
2545  /*
2546  * Cycle on next curstylesheet import.
2547  */
2548  curstyle = xsltNextImport(curstyle);
2549  }
2550 
2551 error:
2552  return(NULL);
2553 }
#define error(str)
Definition: mkdosfs.c:1605
xsltStylesheetPtr xsltNextImport(xsltStylesheetPtr cur)
Definition: imports.c:250
#define XSLT_PAT_NO_PRIORITY
struct node node
smooth NULL
Definition: ftsmooth.c:416
xsltDocumentPtr document
static int xsltTestCompMatch(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp, xmlNodePtr matchNode, const xmlChar *mode, const xmlChar *modeURI)
Definition: pattern.c:908
XMLPUBFUN void *XMLCALL xmlHashLookup3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3)
Definition: hash.c:767
const xmlChar * modeURI
void * psvi
Definition: tree.h:581
struct list * next
Definition: list.h:38
Definition: cookie.c:170
xsltCompMatch * xsltCompMatchPtr
Definition: pattern.h:29
int ret
xmlAttr * xmlAttrPtr
Definition: tree.h:433
__u8 attr
Definition: mkdosfs.c:359
unsigned char xmlChar
Definition: xmlstring.h:28
Definition: _list.h:228
xmlDoc * xmlDocPtr
Definition: tree.h:550
xsltStylesheetPtr style
static int xsltComputeAllKeys(xsltTransformContextPtr ctxt, xmlNodePtr contextNode)
Definition: pattern.c:2273
const xmlChar * mode
Definition: tree.h:551
Definition: tree.h:434
Definition: name.c:36
static int priority
Definition: timer.c:163
Arabic default style
Definition: afstyles.h:93
Definition: dlist.c:348

Referenced by xsltApplyImports(), xsltDefaultProcessOneNode(), and xsltProcessOneNode().

◆ xsltNormalizeCompSteps()

XSLTPUBFUN void XSLTCALL xsltNormalizeCompSteps ( void payload,
void data,
const xmlChar name 
)

◆ xsltTestCompMatchList()

XSLTPUBFUN int XSLTCALL xsltTestCompMatchList ( xsltTransformContextPtr  ctxt,
xmlNodePtr  node,
xsltCompMatchPtr  comp 
)

xsltTestCompMatchList: @ctxt: a XSLT process context @node: a node @comp: the precompiled pattern list

Test whether the node matches one of the patterns in the list

Returns 1 if it matches, 0 if it doesn't and -1 in case of failure

Definition at line 1220 of file pattern.c.

1221  {
1222  int ret;
1223 
1224  if ((ctxt == NULL) || (node == NULL))
1225  return(-1);
1226  while (comp != NULL) {
1227  ret = xsltTestCompMatch(ctxt, comp, node, NULL, NULL);
1228  if (ret == 1)
1229  return(1);
1230  comp = comp->next;
1231  }
1232  return(0);
1233 }
smooth NULL
Definition: ftsmooth.c:416
struct _xsltCompMatch * next
Definition: pattern.c:82
static int xsltTestCompMatch(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp, xmlNodePtr matchNode, const xmlChar *mode, const xmlChar *modeURI)
Definition: pattern.c:908
int ret
Definition: dlist.c:348

Referenced by xsltNumberFormatGetAnyLevel(), xsltNumberFormatGetMultipleLevel(), and xsltTestCompMatchCount().