summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2010-11-08 11:13:17 +0100
committerDaniel Veillard <veillard@redhat.com>2010-11-08 11:13:17 +0100
commitc632bf37dd2c924d20b23c46c9452d29d7739fc8 (patch)
treebf80ad5362dd66f13ff54dd63a664173113cdbbe
parent2c2872e2481d8aac5f1d591f5f0a6150204ad93f (diff)
downloadlibxslt-c632bf37dd2c924d20b23c46c9452d29d7739fc8.tar.gz
libxslt-c632bf37dd2c924d20b23c46c9452d29d7739fc8.tar.bz2
libxslt-c632bf37dd2c924d20b23c46c9452d29d7739fc8.zip
Allow whitespace in xsl:variable with select
Comments are also allowed
-rw-r--r--libxslt/preproc.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/libxslt/preproc.c b/libxslt/preproc.c
index b47d8099..0e393437 100644
--- a/libxslt/preproc.c
+++ b/libxslt/preproc.c
@@ -1844,6 +1844,9 @@ xsltVariableComp(xsltStylesheetPtr style, xmlNodePtr inst) {
comp->select = xsltGetCNsProp(style, inst, (const xmlChar *)"select",
XSLT_NAMESPACE);
if (comp->select != NULL) {
+#ifndef XSLT_REFACTORED
+ xmlNodePtr cur;
+#endif
comp->comp = xsltXPathCompile(style, comp->select);
if (comp->comp == NULL) {
xsltTransformError(NULL, style, inst,
@@ -1851,12 +1854,25 @@ xsltVariableComp(xsltStylesheetPtr style, xmlNodePtr inst) {
comp->select);
style->errors++;
}
+#ifdef XSLT_REFACTORED
if (inst->children != NULL) {
xsltTransformError(NULL, style, inst,
- "XSLT-variable: The must be no child nodes, since the "
+ "XSLT-variable: There must be no child nodes, since the "
"attribute 'select' was specified.\n");
style->errors++;
}
+#else
+ for (cur = inst->children; cur != NULL; cur = cur->next) {
+ if (cur->type != XML_COMMENT_NODE &&
+ (cur->type != XML_TEXT_NODE || !xsltIsBlank(cur->content)))
+ {
+ xsltTransformError(NULL, style, inst,
+ "XSLT-variable: There must be no child nodes, since the "
+ "attribute 'select' was specified.\n");
+ style->errors++;
+ }
+ }
+#endif
}
}