} else if (counter > 1) {
php_error(E_WARNING, "Cannot assign to an array of nodes (duplicate subnodes or attr detected)\n");
} else {
- php_error(E_WARNING, "Cannot create new atrribute\n");
+ switch (Z_TYPE_P(value)) {
+ case IS_LONG:
+ case IS_BOOL:
+ case IS_DOUBLE:
+ case IS_NULL:
+ convert_to_string(value);
+ case IS_STRING:
+ newnode = (xmlNodePtr)xmlNewProp(node, name, Z_STRVAL_P(value));
+ break;
+ default:
+ php_error(E_WARNING, "It is not yet possible to assign complex types to attributes");
+ }
}
}