834 cxDefineDestructor(namespaces, free); |
834 cxDefineDestructor(namespaces, free); |
835 |
835 |
836 { |
836 { |
837 char prefix[8]; |
837 char prefix[8]; |
838 int pfxnum = 0; |
838 int pfxnum = 0; |
839 if (data->set) { |
839 if (cxListSize(data->set) > 0) { |
840 CxIterator i = cxListIterator(data->set); |
840 CxIterator i = cxListIterator(data->set); |
841 cx_foreach(DavProperty*, p, i) { |
841 cx_foreach(DavProperty*, p, i) { |
842 if (strcmp(p->ns->name, "DAV:")) { |
842 if (strcmp(p->ns->name, "DAV:")) { |
843 snprintf(prefix, 8, "x%d", pfxnum++); |
843 snprintf(prefix, 8, "x%d", pfxnum++); |
844 cxMapPut(namespaces, cx_hash_key_str(p->ns->name), strdup(prefix)); |
844 cxMapPut(namespaces, cx_hash_key_str(p->ns->name), strdup(prefix)); |
845 } |
845 } |
846 } |
846 } |
847 } |
847 } |
848 if (data->remove) { |
848 if (cxListSize(data->remove) > 0) { |
849 CxIterator i = cxListIterator(data->remove); |
849 CxIterator i = cxListIterator(data->remove); |
850 cx_foreach(DavProperty*, p, i) { |
850 cx_foreach(DavProperty*, p, i) { |
851 if (strcmp(p->ns->name, "DAV:")) { |
851 if (strcmp(p->ns->name, "DAV:")) { |
852 snprintf(prefix, 8, "x%d", pfxnum++); |
852 snprintf(prefix, 8, "x%d", pfxnum++); |
853 cxMapPut(namespaces, cx_hash_key_str(p->ns->name), strdup(prefix)); |
853 cxMapPut(namespaces, cx_hash_key_str(p->ns->name), strdup(prefix)); |