+Thu Mar 21 17:19:56 CET 2002 Daniel Veillard <daniel@veillard.com>
+
+ * libxslt/transform.c: found another stupid bug by step by
+ step processing of the code
+ * libxslt/pattern.c: idem, except that once stupid mistake
+ ELEM vs NODE forced the templates to be stored in a list
+ instead of a hash table, fixing this stupidity should
+ again lead to a substantive improvement of processing speed.
+ Like divide by 2 processing time for DocBook stylesheets.
+
Thu Mar 21 00:25:12 CET 2002 Daniel Veillard <daniel@veillard.com>
* libxslt/transform.c: fixing bug #75603
return(0);
if (step->value == NULL)
continue;
+ if (step->value[0] != node->name[0])
+ return(0);
if (!xmlStrEqual(step->value, node->name))
return(0);
if (step->value != NULL) {
while (lst != NULL) {
if ((lst->type == XML_ELEMENT_NODE) &&
+ (step->value[0] == lst->name[0]) &&
(xmlStrEqual(step->value, lst->name)))
break;
lst = lst->next;
return(0);
if (step->value == NULL)
continue;
+ if (step->value[0] != node->name[0])
+ return(0);
if (!xmlStrEqual(step->value, node->name))
return(0);
return(0);
if (step->value == NULL)
continue;
+ if (step->value[0] != node->name[0])
+ return(0);
if (!xmlStrEqual(step->value, node->name))
return(0);
/* Namespace test */
while (node != NULL) {
if (node == NULL)
return(0);
- if (xmlStrEqual(step->value, node->name)) {
+ if ((node->type == XML_ELEMENT_NODE) &&
+ (step->value[0] == node->name[0]) &&
+ (xmlStrEqual(step->value, node->name))) {
/* Namespace test */
if (node->ns == NULL) {
if (step->value2 == NULL)
while (sibling != NULL) {
if (sibling == previous)
break;
- if (xmlStrEqual(node->name, sibling->name)) {
+ if ((node->type == XML_ELEMENT_NODE) &&
+ (node->name[0] == sibling->name[0]) &&
+ (xmlStrEqual(node->name, sibling->name))) {
if ((select->value2 == NULL) ||
((sibling->ns != NULL) &&
(xmlStrEqual(select->value2,
if (siblings == node) {
len++;
pos = len;
- } else if (xmlStrEqual(node->name,
- siblings->name)) {
+ } else if ((node->name[0] == siblings->name[0])
+ && (xmlStrEqual(node->name, siblings->name))) {
if ((select->value2 == NULL) ||
((siblings->ns != NULL) &&
(xmlStrEqual(select->value2,
} else if ((select != NULL) && (select->op == XSLT_OP_ALL) &&
(node->type == XML_ELEMENT_NODE)) {
xmlNodePtr previous;
- int index, nocache;
+ int index, nocache = 0;
previous = (xmlNodePtr)
XSLT_RUNTIME_EXTRA(ctxt, select->previousExtra);
else
top = (xsltCompMatchPtr *) &(style->attrMatch);
break;
- case XSLT_OP_ELEM:
case XSLT_OP_CHILD:
case XSLT_OP_PARENT:
case XSLT_OP_ANCESTOR:
case XSLT_OP_TEXT:
top = (xsltCompMatchPtr *) &(style->textMatch);
break;
+ case XSLT_OP_ELEM:
case XSLT_OP_NODE:
if (pat->steps[0].value != NULL)
name = pat->steps[0].value;
else
top = (xsltCompMatchPtr *) &(style->elemMatch);
-
break;
}
if (name != NULL) {
/*
* Handling of Elements: second pass, actual processing
*/
- attrs = node->properties;
- while (attrs != NULL) {
- template = xsltGetTemplate(ctxt, (xmlNodePtr) attrs, NULL);
- if (template) {
- xsltApplyOneTemplate(ctxt, node, template->content, template,
- NULL);
+ if (node->type == XML_ELEMENT_NODE) {
+ attrs = node->properties;
+ while (attrs != NULL) {
+ template = xsltGetTemplate(ctxt, (xmlNodePtr) attrs, NULL);
+ if (template) {
+ xsltApplyOneTemplate(ctxt, node, template->content, template,
+ NULL);
+ }
+ attrs = attrs->next;
}
- attrs = attrs->next;
}
oldSize = ctxt->xpathCtxt->contextSize;
oldPos = ctxt->xpathCtxt->proximityPosition;