* daniel@veillard.com
*/
-#define IN_LIBXSLT
-#include "libxslt.h"
-
-#include <string.h>
-
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-#include <libxml/valid.h>
-#include <libxml/hash.h>
-#include <libxml/uri.h>
-#include <libxml/encoding.h>
-#include <libxml/xmlerror.h>
-#include "xslt.h"
-#include "xsltutils.h"
-#include "xsltInternals.h"
-#include "transform.h"
-#include "templates.h"
-#include "variables.h"
-#include "numbersInternals.h"
-#include "preproc.h"
-#include "extra.h"
-#include "imports.h"
-#include "extensions.h"
-#include "pattern.h"
+#include "precomp.h"
#ifdef WITH_XSLT_DEBUG
#define WITH_XSLT_DEBUG_PREPROC
#ifdef XSLT_REFACTORED
comp->nsPrefix = prefix;
comp->name = name;
+#else
+ (void)name; /* Suppress unused variable warning. */
#endif
} else if (prefix != NULL) {
xsltTransformError(NULL, style, inst,
#ifdef XSLT_REFACTORED
comp->nsPrefix = prefix;
comp->name = name;
+#else
+ (void)name; /* Suppress unused variable warning. */
#endif
} else {
xsltTransformError(NULL, style, inst,
if (prop == NULL) {
style->errors++;
} else {
- *localName = prop;
+ if (localName)
+ *localName = prop;
if (hasProp)
*hasProp = 1;
if (URI != NULL) {
return;
cur->psvi = comp;
- if ((style == NULL) || (cur == NULL))
- return;
-
comp->numdata.doc = cur->doc;
comp->numdata.node = cur;
comp->numdata.value = xsltGetCNsProp(style, cur, (const xmlChar *)"value",
} else if (IS_XSLT_NAME(inst, "attribute")) {
xmlNodePtr parent = inst->parent;
- if ((parent == NULL) || (parent->ns == NULL) ||
+ if ((parent == NULL) ||
+ (parent->type != XML_ELEMENT_NODE) || (parent->ns == NULL) ||
((parent->ns != inst->ns) &&
(!xmlStrEqual(parent->ns->href, inst->ns->href))) ||
(!xmlStrEqual(parent->name, BAD_CAST "attribute-set"))) {
xsltCheckInstructionElement(style, inst);
inst->psvi = (void *) xsltDocumentComp(style, inst,
(xsltTransformFunction) xsltDocumentElem);
- } else {
+ } else if ((style == NULL) || (style->forwards_compatible == 0)) {
xsltTransformError(NULL, style, inst,
"xsltStylePreCompute: unknown xsl:%s\n", inst->name);
if (style != NULL) style->warnings++;