libidav/xml.c

changeset 666
97061483d06e
parent 588
0cfe006fcad2
child 736
40be8db6fe45
equal deleted inserted replaced
665:ec8c9201a974 666:97061483d06e
167 char *tagend = node->children ? ">" : " />"; 167 char *tagend = node->children ? ">" : " />";
168 char *prefix = NULL; 168 char *prefix = NULL;
169 if(node->namespace) { 169 if(node->namespace) {
170 prefix = ucx_map_cstr_get(nsmap, node->namespace); 170 prefix = ucx_map_cstr_get(nsmap, node->namespace);
171 if(!prefix) { 171 if(!prefix) {
172 sstr_t newpre = ucx_sprintf("x%d", (int)nsmap->count); 172 sstr_t newpre = ucx_sprintf("x%d", (int)nsmap->count+1);
173 ucx_map_cstr_put(nsmap, node->namespace, newpre.ptr); 173 // TODO: fix namespace declaration
174 //ucx_map_cstr_put(nsmap, node->namespace, newpre.ptr);
174 prefix = newpre.ptr; 175 prefix = newpre.ptr;
175 ucx_fprintf( 176 ucx_fprintf(
176 stream, 177 stream,
177 writef, 178 writef,
178 "<%s:%s xmlns:%s=\"%s\"", 179 "<%s:%s xmlns:%s=\"%s\"",

mercurial