+Sat Jan 22 22:14:26 CET 2005 Daniel Veillard <daniel@veillard.com>
+
+ * libxslt/pattern.c libxslt/preproc.c libxslt/templates.c
+ libxslt/xslt.c libxslt/xsltInternals.h: chasing xmlStrEqual
+ calls and removed them when comparing mode and modeURI for
+ templates by interning those strings when compiling the
+ stylesheets.
+
Sat Jan 22 19:17:13 CET 2005 Daniel Veillard <daniel@veillard.com>
* configure.in: small fix for local setup
return;
if (comp->pattern != NULL)
xmlFree((xmlChar *)comp->pattern);
- if (comp->mode != NULL)
- xmlFree((xmlChar *)comp->mode);
- if (comp->modeURI != NULL)
- xmlFree((xmlChar *)comp->modeURI);
if (comp->nsList != NULL)
xmlFree(comp->nsList);
for (i = 0;i < comp->nbStep;i++) {
if (mode != NULL) {
if (comp->mode == NULL)
return(0);
- if ((comp->mode != mode) && (!xmlStrEqual(comp->mode, mode)))
+ /*
+ * both mode strings must be interned on the stylesheet dictionary
+ */
+ if (comp->mode != mode)
return(0);
} else {
if (comp->mode != NULL)
if (modeURI != NULL) {
if (comp->modeURI == NULL)
return(0);
- if ((comp->modeURI != modeURI) &&
- (!xmlStrEqual(comp->modeURI, modeURI)))
+ /*
+ * both modeURI strings must be interned on the stylesheet dictionary
+ */
+ if (comp->modeURI != modeURI)
return(0);
} else {
if (comp->modeURI != NULL)
pat->template = cur;
if (mode != NULL)
- pat->mode = xmlStrdup(mode);
+ pat->mode = xmlDictLookup(style->dict, mode, -1);
if (modeURI != NULL)
- pat->modeURI = xmlStrdup(modeURI);
+ pat->modeURI = xmlDictLookup(style->dict, modeURI, -1);
if (priority != XSLT_PAT_NO_PRIORITY)
pat->priority = priority;
if (prop == NULL) {
if (style != NULL) style->errors++;
} else {
- comp->mode = prop;
+ comp->mode = xmlDictLookup(style->dict, prop, -1);
if (URI != NULL) {
- comp->modeURI = xmlStrdup(URI);
+ comp->modeURI = xmlDictLookup(style->dict, URI, -1);
} else {
comp->modeURI = NULL;
}
} else if ((ctxt->internalized) && (target != NULL) &&
(target->doc != NULL) &&
(target->doc->dict == ctxt->dict)) {
- text->content = value;
+ text->content = (xmlChar *) value;
} else {
text->content = xmlStrdup(value);
}
if (template->match) xmlFree(template->match);
if (template->name) xmlFree(template->name);
if (template->nameURI) xmlFree(template->nameURI);
+/*
if (template->mode) xmlFree(template->mode);
if (template->modeURI) xmlFree(template->modeURI);
+ */
if (template->inheritedNs) xmlFree(template->inheritedNs);
memset(template, -1, sizeof(xsltTemplate));
xmlFree(template);
if (URI != NULL)
modeURI = xmlStrdup(URI);
}
- ret->mode = mode;
- ret->modeURI = modeURI;
+ ret->mode = xmlDictLookup(style->dict, mode, -1);
+ ret->modeURI = xmlDictLookup(style->dict, modeURI, -1);
#ifdef WITH_XSLT_DEBUG_PARSING
xsltGenericDebug(xsltGenericDebugContext,
"xsltParseStylesheetTemplate: mode %s\n", mode);
#endif
- } else {
- mode = NULL;
- modeURI = NULL;
+ if (mode != NULL) xmlFree(mode);
+ if (modeURI != NULL) xmlFree(modeURI);
}
prop = xsltGetNsProp(template, (const xmlChar *)"match", XSLT_NAMESPACE);
if (prop != NULL) {
xsltParseTemplateContent(style, template);
ret->elem = template;
ret->content = template->children;
- xsltAddTemplate(style, ret, mode, modeURI);
+ xsltAddTemplate(style, ret, ret->mode, ret->modeURI);
error:
for (;exclPrefixes > 0;exclPrefixes--)
float priority; /* as given from the stylesheet, not computed */
xmlChar *name; /* the local part of the name QName */
xmlChar *nameURI; /* the URI part of the name QName */
- xmlChar *mode; /* the local part of the mode QName */
- xmlChar *modeURI; /* the URI part of the mode QName */
+ const xmlChar *mode;/* the local part of the mode QName */
+ const xmlChar *modeURI;/* the URI part of the mode QName */
xmlNodePtr content; /* the template replacement value */
xmlNodePtr elem; /* the source element */
*
* extra version information, used to show a CVS compilation
*/
-#define LIBXSLT_VERSION_EXTRA "-CVS990"
+#define LIBXSLT_VERSION_EXTRA "-CVS991"
/**
* WITH_XSLT_DEBUG: