OLD | NEW |
1 /* | 1 /* |
2 * attributes.c: Implementation of the XSLT attributes handling | 2 * attributes.c: Implementation of the XSLT attributes handling |
3 * | 3 * |
4 * Reference: | 4 * Reference: |
5 * http://www.w3.org/TR/1999/REC-xslt-19991116 | 5 * http://www.w3.org/TR/1999/REC-xslt-19991116 |
6 * | 6 * |
7 * See Copyright for the status of this software. | 7 * See Copyright for the status of this software. |
8 * | 8 * |
9 * daniel@veillard.com | 9 * daniel@veillard.com |
10 */ | 10 */ |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 copyTxt->parent = (xmlNodePtr) attr; | 971 copyTxt->parent = (xmlNodePtr) attr; |
972 copyTxt->doc = attr->doc; | 972 copyTxt->doc = attr->doc; |
973 /* | 973 /* |
974 * Copy "disable-output-escaping" information. | 974 * Copy "disable-output-escaping" information. |
975 * TODO: Does this have any effect for attribute values | 975 * TODO: Does this have any effect for attribute values |
976 * anyway? | 976 * anyway? |
977 */ | 977 */ |
978 if (inst->children->name == xmlStringTextNoenc) | 978 if (inst->children->name == xmlStringTextNoenc) |
979 copyTxt->name = xmlStringTextNoenc; | 979 copyTxt->name = xmlStringTextNoenc; |
980 | 980 |
| 981 /* |
| 982 * since we create the attribute without content IDness must be |
| 983 * asserted as a second step |
| 984 */ |
| 985 if ((copyTxt->content != NULL) && |
| 986 (xmlIsID(attr->doc, attr->parent, attr))) |
| 987 xmlAddID(NULL, attr->doc, copyTxt->content, attr); |
981 } else { | 988 } else { |
982 /* | 989 /* |
983 * The sequence constructor might be complex, so instantiate it. | 990 * The sequence constructor might be complex, so instantiate it. |
984 */ | 991 */ |
985 value = xsltEvalTemplateString(ctxt, contextNode, inst); | 992 value = xsltEvalTemplateString(ctxt, contextNode, inst); |
986 if (value != NULL) { | 993 if (value != NULL) { |
987 attr = xmlSetNsProp(ctxt->insert, ns, name, value); | 994 attr = xmlSetNsProp(ctxt->insert, ns, name, value); |
988 xmlFree(value); | 995 xmlFree(value); |
989 } else { | 996 } else { |
990 /* | 997 /* |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 * | 1130 * |
1124 * Free up the memory used by attribute sets | 1131 * Free up the memory used by attribute sets |
1125 */ | 1132 */ |
1126 void | 1133 void |
1127 xsltFreeAttributeSetsHashes(xsltStylesheetPtr style) { | 1134 xsltFreeAttributeSetsHashes(xsltStylesheetPtr style) { |
1128 if (style->attributeSets != NULL) | 1135 if (style->attributeSets != NULL) |
1129 xmlHashFree((xmlHashTablePtr) style->attributeSets, | 1136 xmlHashFree((xmlHashTablePtr) style->attributeSets, |
1130 (xmlHashDeallocator) xsltFreeAttrElemList); | 1137 (xmlHashDeallocator) xsltFreeAttrElemList); |
1131 style->attributeSets = NULL; | 1138 style->attributeSets = NULL; |
1132 } | 1139 } |
OLD | NEW |