version 1.1.2.3, 2010/09/28 11:01:18
|
version 1.1.2.4, 2010/09/28 11:37:04
|
Line 99 main(int argc, char **argv)
|
Line 99 main(int argc, char **argv)
|
} |
} |
|
|
switch (m) { |
switch (m) { |
case 's': |
|
break; |
|
case 'g': |
case 'g': |
if (!xr.xml_namespace.vallen) { |
if (!xr.xml_namespace.vallen) { |
if (ret == 32) { |
if (ret == 32) { |
Line 189 main(int argc, char **argv)
|
Line 187 main(int argc, char **argv)
|
printf("%s\n", ctx); |
printf("%s\n", ctx); |
ret = 0; |
ret = 0; |
break; |
break; |
|
case 's': |
|
if (!xr.xml_namespace.vallen) { |
|
if (ret == 32) { |
|
// insert new |
|
} else { |
|
// update old |
|
if (!(node = axl_doc_find_called(doc, xr.xml_node.container.value))) { |
|
printf("SET:: node %s - not found!\n", xr.xml_node.container.value); |
|
ret = 1; |
|
goto end; |
|
} |
|
} |
|
} else { |
|
strlcpy(str, xr.xml_namespace.value, sizeof str); |
|
strlcat(str, ":", sizeof str); |
|
strlcat(str, xr.xml_node.container.value, sizeof str); |
|
if (ret == 32) { |
|
// insert new |
|
} else { |
|
// update old |
|
if (!(node = axl_doc_find_called(doc, str))) { |
|
printf("SET:: node %s:%s - not found!\n", xr.xml_namespace.value, |
|
xr.xml_node.container.value); |
|
ret = 1; |
|
goto end; |
|
} |
|
} |
|
} |
|
|
|
if (!(ret & 32) && xr.xml_data.vallen) { |
|
axl_node_set_is_empty(node, 1); |
|
axl_node_set_content(node, xr.xml_data.value, xr.xml_data.vallen); |
|
} |
|
if (!(ret & 32) && xr.xml_attribute.vallen) { |
|
axl_node_remove_attribute(node, xr.xml_attribute.value); |
|
axl_node_set_attribute(node, xr.xml_attribute.value, xr.xml_value.value); |
|
} |
|
|
|
xr.xml_data = xr.xml_node.container; |
|
ret = 0; |
default: |
default: |
if (xr.xml_data.vallen) { |
if (xr.xml_data.vallen) { |
if (!(node = axl_doc_find_called(doc, xr.xml_data.value))) { |
if (!(node = axl_doc_find_called(doc, xr.xml_data.value))) { |