From 70cf37bdf2a327c947b4a82adc86d16906ca80c3 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Sat, 6 Oct 2001 18:37:20 +0000 Subject: [PATCH] Previous patch was wrong, more work needed, rolling back, Daniel --- libxslt/numbers.c | 45 +++++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/libxslt/numbers.c b/libxslt/numbers.c index e82300a..2f6a970 100644 --- a/libxslt/numbers.c +++ b/libxslt/numbers.c @@ -387,39 +387,28 @@ xsltNumberFormatGetAnyLevel(xsltTransformContextPtr context, context->xpathCtxt->node = node; parser = xmlXPathNewParserContext(NULL, context->xpathCtxt); if (parser) { - /* self */ - if ((countPat != NULL) && - xsltTestCompMatchList(context, node, countPat)) { - cnt++; - } - /* preceding */ - if (keep_going) { - for (preceding = xmlXPathNextPreceding(parser, node); - preceding != NULL; - preceding = xmlXPathNextPreceding(parser, preceding)) { - if ((from != NULL) && - xsltTestCompMatchList(context, preceding, fromPat)) { - keep_going = FALSE; - break; /* for */ - } - if (count == NULL) { - if ((node->type == preceding->type) && - /* - * FIXME: must use expanded-name instead of - * local name - * */ - xmlStrEqual(node->name, preceding->name)) - cnt++; - } else { - if (xsltTestCompMatchList(context, preceding, countPat)) - cnt++; - } + for (preceding = xmlXPathNextPreceding(parser, node); + preceding != NULL; + preceding = xmlXPathNextPreceding(parser, preceding)) { + if ((from != NULL) && + xsltTestCompMatchList(context, preceding, fromPat)) { + keep_going = FALSE; + break; /* for */ + } + if (count == NULL) { + if ((node->type == preceding->type) && + /* FIXME: must use expanded-name instead of local name */ + xmlStrEqual(node->name, preceding->name)) + cnt++; + } else { + if (xsltTestCompMatchList(context, preceding, countPat)) + cnt++; } } - /* ancestor */ if (keep_going) { + /* ancestor-or-self */ for (ancestor = node; ancestor != NULL; ancestor = xmlXPathNextAncestor(parser, ancestor)) { -- 2.7.4