+Tue Dec 27 17:50:10 HKT 2004 William Brack <wbrack@mmm.com.hk>
+
+ * libxslt/pattern.c: fixed a problem with the expression
+ "*//name" (bug 162265), also a small problem with the '|'
+ operator.
+
Thu Dec 23 16:04:47 HKT 2004 William Brack <wbrack@mmm.com.hk>
* libxslt/transform.c, libxslt/templates.c: fixed a couple of
* @mode: the mode name or NULL
* @modeURI: the mode URI or NULL
*
- * Test wether the node matches the pattern
+ * Test whether the node matches the pattern
*
* Returns 1 if it matches, 0 if it doesn't and -1 in case of failure
*/
step = &comp->steps[i];
if (step->op == XSLT_OP_ROOT)
return(1);
- if (step->op != XSLT_OP_ELEM)
+ if ((step->op != XSLT_OP_ELEM) && (step->op != XSLT_OP_ALL))
return(0);
- if (step->value == NULL)
+ if ((step->value == NULL) && (step->op != XSLT_OP_ALL))
return(-1);
}
if (node == NULL)
(node->type == XML_NAMESPACE_DECL))
return(0);
node = node->parent;
+ if (step->value == NULL)
+ continue;
while (node != NULL) {
if (node == NULL)
return(0);
* @node: a node
* @comp: the precompiled pattern list
*
- * Test wether the node matches one of the patterns in the 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
*/
PUSH(XSLT_OP_PARENT, NULL, NULL);
NEXT;
SKIP_BLANKS;
- if ((CUR != 0) || (CUR == '|')) {
+ if ((CUR != 0) && (CUR != '|')) {
xsltCompileRelativePathPattern(ctxt, NULL);
}
} else {
NEXT;
SKIP_BLANKS;
PUSH(XSLT_OP_ROOT, NULL, NULL);
- if ((CUR != 0) || (CUR == '|')) {
+ if ((CUR != 0) && (CUR != '|')) {
PUSH(XSLT_OP_PARENT, NULL, NULL);
xsltCompileRelativePathPattern(ctxt, NULL);
}
}
if (name != NULL) {
/*
- * find the list of appliable expressions based on the name
+ * find the list of applicable expressions based on the name
*/
list = (xsltCompMatchPtr) xmlHashLookup3(curstyle->templatesHash,
name, ctxt->mode, ctxt->modeURI);