Skip to content
Snippets Groups Projects
Commit db80f0feae3c authored by William M. Brack's avatar William M. Brack
Browse files

changed priority of template patterns starting with '//' from 0.0 to 0.5

* libxslt/pattern.c: changed priority of template patterns
  starting with '//' from 0.0 to 0.5 (Bug 131705)
parent a2d4c109f523
No related branches found
No related tags found
No related merge requests found
Fri Jan 23 18:52:22 HKT 2004 William Brack <wbrack@mmm.com.hk>
* libxslt/pattern.c: changed priority of template patterns
starting with '//' from 0.0 to 0.5 (Bug 131705)
Thu Jan 22 18:42:03 CET 2004 Daniel Veillard <daniel@veillard.com>
* libxslt/xslt.c: applied patch from Stefan Kost to fix
......
......@@ -1643,6 +1643,7 @@
*/
NEXT;
NEXT;
ctxt->comp->priority = 0.5; /* '//' means not 0 priority */
xsltCompileRelativePathPattern(ctxt, NULL);
} else if (CUR == '/') {
/*
......@@ -1784,6 +1785,11 @@
"xsltCompilePattern : parsing '%s'\n",
element->pattern);
#endif
/*
Preset default priority to be zero.
This may be changed by xsltCompileLocationPathPattern.
*/
element->priority = 0;
xsltCompileLocationPathPattern(ctxt);
if (ctxt->error) {
xsltTransformError(NULL, style, node,
......@@ -1801,4 +1807,5 @@
/*
* Set-up the priority
*/
if (element->priority == 0) { /* if not yet determined */
if (((element->steps[0].op == XSLT_OP_ELEM) ||
......@@ -1804,4 +1811,5 @@
if (((element->steps[0].op == XSLT_OP_ELEM) ||
(element->steps[0].op == XSLT_OP_ATTR)) &&
(element->steps[0].op == XSLT_OP_ATTR) ||
(element->steps[0].op == XSLT_OP_PI)) &&
(element->steps[0].value != NULL) &&
(element->steps[1].op == XSLT_OP_END)) {
......@@ -1806,15 +1814,6 @@
(element->steps[0].value != NULL) &&
(element->steps[1].op == XSLT_OP_END)) {
element->priority = 0;
#if 0
} else if ((element->steps[0].op == XSLT_OP_ROOT) &&
(element->steps[1].op == XSLT_OP_END)) {
element->priority = 0;
#endif
} else if ((element->steps[0].op == XSLT_OP_PI) &&
(element->steps[0].value != NULL) &&
(element->steps[1].op == XSLT_OP_END)) {
element->priority = 0;
; /* previously preset */
} else if ((element->steps[0].op == XSLT_OP_ATTR) &&
(element->steps[0].value2 != NULL) &&
(element->steps[1].op == XSLT_OP_END)) {
......@@ -1838,6 +1837,7 @@
} else {
element->priority = 0.5;
}
}
#ifdef WITH_XSLT_DEBUG_PATTERN
xsltGenericDebug(xsltGenericDebugContext,
"xsltCompilePattern : parsed %s, default priority %f\n",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment