+Fri Feb 7 14:18:40 CET 2003 Daniel Veillard <daniel@veillard.com>
+
+ * libxslt/extensions.c libxslt/keys.c libxslt/pattern.c
+ libxslt/preproc.c libxslt/transform.c libxslt/variables.c
+ libxslt/xslt.c: tried to fix 105387 and all similar cases
+ in the library sources.
+
Wed Feb 5 16:04:10 CET 2003 Daniel Veillard <daniel@veillard.com>
* doc/* configure.in: preparing for release of 1.0.25
if (testStyleData == NULL) {
xsltTransformError(NULL, style, inst,
"xsltExtElementPreCompTest: not initialized\n");
- style->errors++;
+ if (style != NULL) style->errors++;
return (NULL);
}
}
if (inst == NULL) {
xsltTransformError(NULL, style, inst,
"xsltExtElementPreCompTest: no instruction\n");
- style->errors++;
+ if (style != NULL) style->errors++;
return (NULL);
}
ret = xsltNewElemPreComp (style, inst, function);
if (current == end) {
xsltTransformError(NULL, style, inst,
"key pattern is empty\n");
- style->errors++;
+ if (style != NULL) style->errors++;
goto error;
}
if (match[start] != '/') {
pattern = xmlStrcat(pattern, (xmlChar *)"//");
if (pattern == NULL) {
- style->errors++;
+ if (style != NULL) style->errors++;
goto error;
}
}
pattern = xmlStrncat(pattern, &match[start], end - start);
if (pattern == NULL) {
- style->errors++;
+ if (style != NULL) style->errors++;
goto error;
}
xsltTransformError(NULL, style, inst,
"xsl:key : XPath pattern compilation failed '%s'\n",
pattern);
- style->errors++;
+ if (style != NULL) style->errors++;
}
key->usecomp = xmlXPathCompile(use);
if (key->usecomp == NULL) {
xsltTransformError(NULL, style, inst,
"xsl:key : XPath pattern compilation failed '%s'\n",
use);
- style->errors++;
+ if (style != NULL) style->errors++;
}
key->next = style->keys;
style->keys = key;
xsltTransformError(NULL, style, node,
"xsltCompilePattern : failed to compile '%s'\n",
element->pattern);
- style->errors++;
+ if (style != NULL) style->errors++;
goto error;
}
if (end == 0) {
xsltTransformError(NULL, style, node,
"xsltCompilePattern : NULL pattern\n");
- style->errors++;
+ if (style != NULL) style->errors++;
goto error;
}
if (cur == NULL) {
xsltTransformError(NULL, style, NULL,
"xsltNewStylePreComp : malloc failed\n");
- style->errors++;
+ if (style != NULL) style->errors++;
return(NULL);
}
memset(cur, 0, sizeof(xsltStylePreComp));
if (cur->func == NULL) {
xsltTransformError(NULL, style, NULL,
"xsltNewStylePreComp : no function for type %d\n", type);
- style->errors++;
+ if (style != NULL) style->errors++;
}
}
cur->next = style->preComps;
if (URL == NULL) {
xsltTransformError(NULL, style, inst,
"xsltDocumentComp: URL computation failed %s\n", filename);
- style->warnings++;
+ if (style != NULL) style->warnings++;
comp->filename = xmlStrdup(filename);
} else {
comp->filename = URL;
xsltTransformError(NULL, style, inst,
"xsltSortComp: no support for data-type = %s\n", comp->stype);
comp->number = 0; /* use default */
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
}
comp->order = xsltEvalStaticAttrValueTemplate(style, inst,
xsltTransformError(NULL, style, inst,
"xsltSortComp: invalid value %s for order\n", comp->order);
comp->descending = 0; /* use default */
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
}
comp->case_order = xsltEvalStaticAttrValueTemplate(style, inst,
xsltTransformError(NULL, style, inst,
"xsltSortComp: invalid value %s for order\n", comp->order);
comp->lower_first = 0; /* use default */
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
}
xsltTransformError(NULL, style, inst,
"xsltSortComp: could not compile select expression '%s'\n",
comp->select);
- style->errors++;
+ if (style != NULL) style->errors++;
}
}
(const xmlChar *)"no")){
xsltTransformError(NULL, style, inst,
"xsl:text: disable-output-escaping allows only yes or no\n");
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
xmlFree(prop);
}
if (comp->select == NULL) {
xsltTransformError(NULL, style, inst,
"xsl:copy-of : select is missing\n");
- style->errors++;
+ if (style != NULL) style->errors++;
return;
}
comp->comp = xmlXPathCompile(comp->select);
xsltTransformError(NULL, style, inst,
"xsl:copy-of : could not compile select expression '%s'\n",
comp->select);
- style->errors++;
+ if (style != NULL) style->errors++;
}
}
(const xmlChar *)"no")){
xsltTransformError(NULL, style, inst,
"xsl:value-of : disable-output-escaping allows only yes or no\n");
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
xmlFree(prop);
}
if (comp->select == NULL) {
xsltTransformError(NULL, style, inst,
"xsl:value-of : select is missing\n");
- style->errors++;
+ if (style != NULL) style->errors++;
return;
}
comp->comp = xmlXPathCompile(comp->select);
xsltTransformError(NULL, style, inst,
"xsl:value-of : could not compile select expression '%s'\n",
comp->select);
- style->errors++;
+ if (style != NULL) style->errors++;
}
}
if (prop == NULL) {
xsltTransformError(NULL, style, inst,
"xsl:with-param : name is missing\n");
- style->errors++;
+ if (style != NULL) style->errors++;
} else {
const xmlChar *URI;
URI = xsltGetQNameURI(inst, &prop);
if (prop == NULL) {
- style->errors++;
+ if (style != NULL) style->errors++;
} else {
comp->name = prop;
comp->has_name = 1;
xsltTransformError(NULL, style, inst,
"xsl:param : could not compile select expression '%s'\n",
comp->select);
- style->errors++;
+ if (style != NULL) style->errors++;
}
if (inst->children != NULL) {
xsltTransformError(NULL, style, inst,
"xsl:param : content should be empty since select is present \n");
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
}
}
} else {
xsltTransformError(NULL, style, cur,
"xsl:number : invalid value %s for level\n", prop);
- style->warnings++;
+ if (style != NULL) style->warnings++;
xmlFree(prop);
}
}
if (xmlStrEqual(prop, BAD_CAST("alphabetic"))) {
xsltTransformError(NULL, style, cur,
"xsl:number : letter-value 'alphabetic' not implemented\n");
- style->warnings++;
+ if (style != NULL) style->warnings++;
XSLT_TODO; /* xsl:number letter-value attribute alphabetic */
} else if (xmlStrEqual(prop, BAD_CAST("traditional"))) {
xsltTransformError(NULL, style, cur,
"xsl:number : letter-value 'traditional' not implemented\n");
- style->warnings++;
+ if (style != NULL) style->warnings++;
XSLT_TODO; /* xsl:number letter-value attribute traditional */
} else {
xsltTransformError(NULL, style, cur,
"xsl:number : invalid value %s for letter-value\n", prop);
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
xmlFree(prop);
}
if (prop == NULL) {
xsltTransformError(NULL, style, inst,
"xsl:call-template : name is missing\n");
- style->errors++;
+ if (style != NULL) style->errors++;
} else {
const xmlChar *URI;
URI = xsltGetQNameURI(inst, &prop);
if (prop == NULL) {
- style->errors++;
+ if (style != NULL) style->errors++;
} else {
comp->name = prop;
comp->has_name = 1;
URI = xsltGetQNameURI(inst, &prop);
if (prop == NULL) {
- style->errors++;
+ if (style != NULL) style->errors++;
} else {
comp->mode = prop;
if (URI != NULL) {
xsltTransformError(NULL, style, inst,
"xsl:apply-templates : could not compile select expression '%s'\n",
comp->select);
- style->errors++;
+ if (style != NULL) style->errors++;
}
}
if (comp->test == NULL) {
xsltTransformError(NULL, style, inst,
"xsl:if : test is not defined\n");
- style->errors++;
+ if (style != NULL) style->errors++;
return;
}
comp->comp = xmlXPathCompile(comp->test);
xsltTransformError(NULL, style, inst,
"xsl:if : could not compile test expression '%s'\n",
comp->test);
- style->errors++;
+ if (style != NULL) style->errors++;
}
}
if (comp->test == NULL) {
xsltTransformError(NULL, style, inst,
"xsl:when : test is not defined\n");
- style->errors++;
+ if (style != NULL) style->errors++;
return;
}
comp->comp = xmlXPathCompile(comp->test);
xsltTransformError(NULL, style, inst,
"xsl:when : could not compile test expression '%s'\n",
comp->test);
- style->errors++;
+ if (style != NULL) style->errors++;
}
}
if (comp->select == NULL) {
xsltTransformError(NULL, style, inst,
"xsl:for-each : select is missing\n");
- style->errors++;
+ if (style != NULL) style->errors++;
} else {
comp->comp = xmlXPathCompile(comp->select);
if (comp->comp == NULL) {
xsltTransformError(NULL, style, inst,
"xsl:for-each : could not compile select expression '%s'\n",
comp->select);
- style->errors++;
+ if (style != NULL) style->errors++;
}
}
/* TODO: handle and skip the xsl:sort */
if (prop == NULL) {
xsltTransformError(NULL, style, inst,
"xsl:variable : name is missing\n");
- style->errors++;
+ if (style != NULL) style->errors++;
} else {
const xmlChar *URI;
URI = xsltGetQNameURI(inst, &prop);
if (prop == NULL) {
- style->errors++;
+ if (style != NULL) style->errors++;
} else {
comp->name = prop;
comp->has_name = 1;
xsltTransformError(NULL, style, inst,
"xsl:variable : could not compile select expression '%s'\n",
comp->select);
- style->errors++;
+ if (style != NULL) style->errors++;
}
if (inst->children != NULL) {
xsltTransformError(NULL, style, inst,
"xsl:variable : content should be empty since select is present \n");
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
}
}
if (prop == NULL) {
xsltTransformError(NULL, style, inst,
"xsl:param : name is missing\n");
- style->errors++;
+ if (style != NULL) style->errors++;
} else {
const xmlChar *URI;
URI = xsltGetQNameURI(inst, &prop);
if (prop == NULL) {
- style->errors++;
+ if (style != NULL) style->errors++;
} else {
comp->name = prop;
comp->has_name = 1;
xsltTransformError(NULL, style, inst,
"xsl:param : could not compile select expression '%s'\n",
comp->select);
- style->errors++;
+ if (style != NULL) style->errors++;
}
if (inst->children != NULL) {
xsltTransformError(NULL, style, inst,
"xsl:param : content should be empty since select is present \n");
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
}
}
} else {
xsltTransformError(NULL, style, inst,
"xsltStylePreCompute: unknown xsl:%s\n", inst->name);
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
/*
* Add the namespace lookup here, this code can be shared by
URI = xsltGetQNameURI(inst, &prop);
if (prop == NULL) {
- style->errors++;
+ if (style != NULL) style->errors++;
} else if (URI == NULL) {
if ((xmlStrEqual(prop, (const xmlChar *) "xml")) ||
(xmlStrEqual(prop, (const xmlChar *) "html")) ||
} else {
xsltTransformError(ctxt, NULL, inst,
"invalid value for method: %s\n", prop);
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
} else {
style->method = prop;
xsltTransformError(ctxt, NULL, inst,
"invalid value for standalone: %s\n",
prop);
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
xmlFree(prop);
}
} else {
xsltTransformError(ctxt, NULL, inst,
"invalid value for indent: %s\n", prop);
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
xmlFree(prop);
}
xsltTransformError(ctxt, NULL, inst,
"invalid value for omit-xml-declaration: %s\n",
prop);
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
xmlFree(prop);
}
(elem->comp->inst->doc == def->comp->inst->doc)) {
xsltTransformError(ctxt, style, elem->comp->inst,
"Global variable %s already defined\n", elem->name);
- style->errors++;
+ if (style != NULL) style->errors++;
}
}
elem = elem->next;
(xmlStrEqual(elem->nameURI, tmp->nameURI)))) {
xsltTransformError(NULL, style, comp->inst,
"redefinition of global variable %s\n", elem->name);
- style->errors++;
+ if (style != NULL) style->errors++;
}
if (tmp->next == NULL)
break;
URI = xsltGetQNameURI(cur, &prop);
if (prop == NULL) {
- style->errors++;
+ if (style != NULL) style->errors++;
} else if (URI == NULL) {
if ((xmlStrEqual(prop, (const xmlChar *) "xml")) ||
(xmlStrEqual(prop, (const xmlChar *) "html")) ||
} else {
xsltTransformError(NULL, style, cur,
"invalid value for method: %s\n", prop);
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
} else {
style->method = prop;
} else {
xsltTransformError(NULL, style, cur,
"invalid value for standalone: %s\n", prop);
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
xmlFree(prop);
}
} else {
xsltTransformError(NULL, style, cur,
"invalid value for indent: %s\n", prop);
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
xmlFree(prop);
}
xsltTransformError(NULL, style, cur,
"invalid value for omit-xml-declaration: %s\n",
prop);
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
xmlFree(prop);
}
URI = xsltGetQNameURI(cur, &element);
if (element == NULL) {
- style->errors++;
+ if (style != NULL) style->errors++;
} else {
xmlHashAddEntry2(style->cdataSection, element, URI,
(void *) "cdata");
if (format != NULL) {
xsltTransformError(NULL, style, cur,
"xsltParseStylestyleDecimalFormat: %s already exists\n", prop);
- style->warnings++;
+ if (style != NULL) style->warnings++;
return;
}
format = xsltNewDecimalFormat(prop);
if (format == NULL) {
xsltTransformError(NULL, style, cur,
"xsltParseStylestyleDecimalFormat: failed creating new decimal-format\n");
- style->errors++;
+ if (style != NULL) style->errors++;
return;
}
/* Append new decimal-format structure */
if (elements == NULL) {
xsltTransformError(NULL, style, cur,
"xsltParseStylesheetPreserveSpace: missing elements attribute\n");
- style->warnings++;
+ if (style != NULL) style->warnings++;
return;
}
xsltTransformError(NULL, style, cur,
"xsl:extension-element-prefix : undefined namespace %s\n",
prefix);
- style->warnings++;
+ if (style != NULL) style->warnings++;
} else {
#ifdef WITH_XSLT_DEBUG_PARSING
xsltGenericDebug(xsltGenericDebugContext,
if (elements == NULL) {
xsltTransformError(NULL, style, cur,
"xsltParseStylesheetStripSpace: missing elements attribute\n");
- style->warnings++;
+ if (style != NULL) style->warnings++;
return;
}
xsltTransformError(NULL, style, cur,
"xsl:exclude-result-prefixes : undefined namespace %s\n",
prefix);
- style->warnings++;
+ if (style != NULL) style->warnings++;
} else {
#ifdef WITH_XSLT_DEBUG_PARSING
xsltGenericDebug(xsltGenericDebugContext,
if (style->nsHash == NULL) {
xsltTransformError(NULL, style, cur,
"xsltGatherNamespaces: failed to create hash table\n");
- style->errors++;
+ if (style != NULL) style->errors++;
return;
}
}
if ((URI != NULL) && (!xmlStrEqual(URI, ns->href))) {
xsltTransformError(NULL, style, cur,
"Namespaces prefix %s used for multiple namespaces\n");
- style->warnings++;
+ if (style != NULL) style->warnings++;
} else if (URI == NULL) {
xmlHashUpdateEntry(style->nsHash, ns->prefix,
(void *) ns->href, (xmlHashDeallocator)xmlFree);
(const xmlChar *)"no")){
xsltTransformError(NULL, style, cur,
"xsl:text: disable-output-escaping allows only yes or no\n");
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
xmlFree(prop);
(text->type != XML_CDATA_SECTION_NODE)) {
xsltTransformError(NULL, style, cur,
"xsltParseTemplateContent: xslt:text content problem\n");
- style->errors++;
+ if (style != NULL) style->errors++;
break;
}
if (noesc)
cur = cur->next;
xsltTransformError(NULL, style, cur,
"xsltParseTemplateContent: ignoring misplaced param element\n");
- style->warnings++;
+ if (style != NULL) style->warnings++;
xmlUnlinkNode(param);
xmlFreeNode(param);
continue;
URI = xsltGetQNameURI(key, &prop);
if (prop == NULL) {
- style->errors++;
+ if (style != NULL) style->errors++;
goto error;
} else {
name = prop;
} else {
xsltTransformError(NULL, style, key,
"xsl:key : error missing name\n");
- style->errors++;
+ if (style != NULL) style->errors++;
goto error;
}
if (match == NULL) {
xsltTransformError(NULL, style, key,
"xsl:key : error missing match\n");
- style->errors++;
+ if (style != NULL) style->errors++;
goto error;
}
if (use == NULL) {
xsltTransformError(NULL, style, key,
"xsl:key : error missing use\n");
- style->errors++;
+ if (style != NULL) style->errors++;
goto error;
}
URI = xsltGetQNameURI(template, &prop);
if (prop == NULL) {
- style->errors++;
+ if (style != NULL) style->errors++;
goto error;
} else {
mode = prop;
URI = xsltGetQNameURI(template, &prop);
if (prop == NULL) {
- style->errors++;
+ if (style != NULL) style->errors++;
goto error;
} else {
ret->name = prop;
if (prop == NULL) {
xsltTransformError(NULL, style, top,
"xsl:version is missing: document may not be a stylesheet\n");
- style->warnings++;
+ if (style != NULL) style->warnings++;
} else {
if ((!xmlStrEqual(prop, (const xmlChar *)"1.0")) &&
(!xmlStrEqual(prop, (const xmlChar *)"1.1"))) {
xsltTransformError(NULL, style, top,
"xsl:version: only 1.0 features are supported\n");
/* TODO set up compatibility when not XSLT 1.0 */
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
xmlFree(prop);
}
}
if (IS_XSLT_ELEM(cur) && IS_XSLT_NAME(cur, "import")) {
if (xsltParseStylesheetImport(style, cur) != 0)
- style->errors++;
+ if (style != NULL) style->errors++;
} else
break;
cur = cur->next;
xsltTransformError(NULL, style, cur,
"misplaced text element: '%s'\n", cur->content);
}
- style->errors++;
+ if (style != NULL) style->errors++;
cur = cur->next;
continue;
}
xsltGenericError(xsltGenericErrorContext,
"Found a top-level element %s with null namespace URI\n",
cur->name);
- style->errors++;
+ if (style != NULL) style->errors++;
cur = cur->next;
continue;
}
if (IS_XSLT_NAME(cur, "import")) {
xsltTransformError(NULL, style, cur,
"xsltParseStylesheetTop: ignoring misplaced import element\n");
- style->errors++;
+ if (style != NULL) style->errors++;
} else if (IS_XSLT_NAME(cur, "include")) {
if (xsltParseStylesheetInclude(style, cur) != 0)
- style->errors++;
+ if (style != NULL) style->errors++;
} else if (IS_XSLT_NAME(cur, "strip-space")) {
xsltParseStylesheetStripSpace(style, cur);
} else if (IS_XSLT_NAME(cur, "preserve-space")) {
xsltTransformError(NULL, style, cur,
"xsltParseStylesheetTop: ignoring unknown %s element\n",
cur->name);
- style->warnings++;
+ if (style != NULL) style->warnings++;
}
cur = cur->next;
}