dav/tags.c

changeset 667
6cdcd3e4e368
parent 525
26a1d5b9d9d2
child 747
efbd59642577
equal deleted inserted replaced
666:97061483d06e 667:6cdcd3e4e368
166 DavXmlNode *c = node->children; 166 DavXmlNode *c = node->children;
167 while(c) { 167 while(c) {
168 if(c->type == DAV_XML_ELEMENT) { 168 if(c->type == DAV_XML_ELEMENT) {
169 char *value = dav_xml_getstring(c->children); 169 char *value = dav_xml_getstring(c->children);
170 if(value) { 170 if(value) {
171 if(!strcmp(c->namespace, DAV_NS)) { 171 if(!strcmp(c->namespace, DAV_PROPS_NS)) {
172 if(!strcmp(c->name, "name")) { 172 if(!strcmp(c->name, "name")) {
173 char *value = dav_xml_getstring(c->children); 173 char *value = dav_xml_getstring(c->children);
174 if(value) { 174 if(value) {
175 name = value; 175 name = value;
176 } 176 }
200 UcxList *tags = NULL; 200 UcxList *tags = NULL;
201 201
202 DavXmlNode *node = taglistnode; 202 DavXmlNode *node = taglistnode;
203 while(node) { 203 while(node) {
204 if(node->type == DAV_XML_ELEMENT) { 204 if(node->type == DAV_XML_ELEMENT) {
205 if(!strcmp(node->namespace, DAV_NS) && !strcmp(node->name, "tag")) { 205 if(!strcmp(node->namespace, DAV_PROPS_NS) && !strcmp(node->name, "tag")) {
206 DavTag *tag = parse_xml_dav_tag(node); 206 DavTag *tag = parse_xml_dav_tag(node);
207 if(tag) { 207 if(tag) {
208 tags = ucx_list_append(tags, tag); 208 tags = ucx_list_append(tags, tag);
209 } 209 }
210 } 210 }
219 DavXmlNode *tag1 = NULL; 219 DavXmlNode *tag1 = NULL;
220 DavXmlNode *lasttag = NULL; 220 DavXmlNode *lasttag = NULL;
221 UCX_FOREACH(elm, tags) { 221 UCX_FOREACH(elm, tags) {
222 DavTag *tag = elm->data; 222 DavTag *tag = elm->data;
223 223
224 DavXmlNode *tagelm = dav_xml_createnode(DAV_NS, "tag"); 224 DavXmlNode *tagelm = dav_xml_createnode(DAV_PROPS_NS, "tag");
225 DavXmlNode *tagname = dav_xml_createnode_with_text(DAV_NS, "name", tag->name); 225 DavXmlNode *tagname = dav_xml_createnode_with_text(DAV_PROPS_NS, "name", tag->name);
226 tagelm->children = tagname; 226 tagelm->children = tagname;
227 if(tag->color) { 227 if(tag->color) {
228 DavXmlNode *tagcolor = dav_xml_createnode_with_text(DAV_NS, "color", tag->color); 228 DavXmlNode *tagcolor = dav_xml_createnode_with_text(DAV_PROPS_NS, "color", tag->color);
229 tagname->next = tagcolor; 229 tagname->next = tagcolor;
230 } 230 }
231 231
232 if(lasttag) { 232 if(lasttag) {
233 lasttag->next = tagelm; 233 lasttag->next = tagelm;

mercurial