summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2009-09-24 14:04:17 +0200
committerDaniel Veillard <veillard@redhat.com>2009-09-24 14:04:17 +0200
commitff6923ecd5a96f4425adb9ffaac067b941c96be8 (patch)
treebd2359c766eba0e9b91ffa8ef0cf12840c75dc5d
parent2e8defa7ccef2f76fb1cbfe9e9673d8e4b6cf1d6 (diff)
downloadlibxslt-ff6923ecd5a96f4425adb9ffaac067b941c96be8.tar.gz
Fix an idness generation problem
* libxslt/templates.c: when copying attributes coming from the stylesheet IDness was not asserted, though with xml:id this is now possible.
-rw-r--r--libxslt/templates.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/libxslt/templates.c b/libxslt/templates.c
index 8d26a8a9..c6250dc4 100644
--- a/libxslt/templates.c
+++ b/libxslt/templates.c
@@ -637,7 +637,7 @@ xsltAttrListTemplateProcess(xsltTransformContextPtr ctxt,
last = last->next;
} else {
last = NULL;
- }
+ }
attr = attrs;
do {
/*
@@ -719,20 +719,20 @@ xsltAttrListTemplateProcess(xsltTransformContextPtr ctxt,
copyNs = NULL;
}
copy->ns = copyNs;
-
+
/*
* Set the value.
- */
+ */
text = xmlNewText(NULL);
if (text != NULL) {
copy->last = copy->children = text;
text->parent = (xmlNodePtr) copy;
text->doc = copy->doc;
-
+
if (attr->psvi != NULL) {
/*
* Evaluate the Attribute Value Template.
- */
+ */
valueAVT = xsltEvalAVT(ctxt, attr->psvi, attr->parent);
if (valueAVT == NULL) {
/*
@@ -743,7 +743,7 @@ xsltAttrListTemplateProcess(xsltTransformContextPtr ctxt,
xsltTransformError(ctxt, NULL, attr->parent,
"Internal error: Failed to evaluate the AVT "
"of attribute '{%s}%s'.\n",
- attr->ns->href, attr->name);
+ attr->ns->href, attr->name);
} else {
xsltTransformError(ctxt, NULL, attr->parent,
"Internal error: Failed to evaluate the AVT "
@@ -763,6 +763,9 @@ xsltAttrListTemplateProcess(xsltTransformContextPtr ctxt,
} else {
text->content = xmlStrdup(value);
}
+ if ((copy != NULL) && (text != NULL) &&
+ (xmlIsID(copy->doc, copy->parent, copy)))
+ xmlAddID(NULL, copy->doc, text->content, copy);
}
next_attribute: