NodeType test has wrongly placed
authorBjorn Reese <breese@src.gnome.org>
Sun, 4 Mar 2001 12:43:14 +0000 (12:43 +0000)
committerBjorn Reese <breese@src.gnome.org>
Sun, 4 Mar 2001 12:43:14 +0000 (12:43 +0000)
libxslt/pattern.c

index 1b4eae7..38ace5b 100644 (file)
@@ -1270,24 +1270,22 @@ xsltCompileLocationPathPattern(xsltParserContextPtr ctxt) {
            ctxt->error = 1;
            return;
        }
-       if (!xmlXPathIsNodeType(name)) {
-           SKIP_BLANKS;
-           if (CUR == '(') {
-               xsltCompileIdKeyPattern(ctxt, name, 1);
-               if ((CUR == '/') && (NXT(1) == '/')) {
-                   PUSH(XSLT_OP_ANCESTOR, NULL, NULL);
-                   NEXT;
-                   NEXT;
-                   SKIP_BLANKS;
-                   xsltCompileRelativePathPattern(ctxt, NULL);
-               } else if (CUR == '/') {
-                   PUSH(XSLT_OP_PARENT, NULL, NULL);
-                   NEXT;
-                   SKIP_BLANKS;
-                   xsltCompileRelativePathPattern(ctxt, NULL);
-               }
-               return;
+       SKIP_BLANKS;
+       if ((CUR == '(') && !xmlXPathIsNodeType(name)) {
+           xsltCompileIdKeyPattern(ctxt, name, 1);
+           if ((CUR == '/') && (NXT(1) == '/')) {
+               PUSH(XSLT_OP_ANCESTOR, NULL, NULL);
+               NEXT;
+               NEXT;
+               SKIP_BLANKS;
+               xsltCompileRelativePathPattern(ctxt, NULL);
+           } else if (CUR == '/') {
+               PUSH(XSLT_OP_PARENT, NULL, NULL);
+               NEXT;
+               SKIP_BLANKS;
+               xsltCompileRelativePathPattern(ctxt, NULL);
            }
+           return;
        }
        xsltCompileRelativePathPattern(ctxt, name);
     }