From c2f91449a0d55b498bc0608720c1892eae723e48 Mon Sep 17 00:00:00 2001 From: Bjorn Reese Date: Sun, 4 Mar 2001 12:22:08 +0000 Subject: [PATCH] xsltCompileLocationPathPattern checks for XPath NodeTypes --- ChangeLog | 5 +++++ libxslt/pattern.c | 32 +++++++++++++++++--------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index b572d26..7489aba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Mar 4 13:21:16 CET 2001 Bjorn Reese + + * libxslt/pattern.c: fixed the compilation of patterns which + contains XPath NodeTypes. + Sat Mar 3 20:56:47 CET 2001 Daniel Veillard * libxslt/transform.c: save ctxt->node after for-each diff --git a/libxslt/pattern.c b/libxslt/pattern.c index 5110a2d..1b4eae7 100644 --- a/libxslt/pattern.c +++ b/libxslt/pattern.c @@ -1270,22 +1270,24 @@ xsltCompileLocationPathPattern(xsltParserContextPtr ctxt) { ctxt->error = 1; return; } - 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); + 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; } - return; } xsltCompileRelativePathPattern(ctxt, name); } -- 2.7.4