1
0
Преглед на файлове

libxml2: Read CDATA context in the same way as TEXT context.

Serj Kalichev преди 8 години
родител
ревизия
090b4e6c5c
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4 2
      clish/shell/shell_libxml2.c

+ 4 - 2
clish/shell/shell_libxml2.c

@@ -234,7 +234,8 @@ int clish_xmlnode_get_content(clish_xmlnode_t *node, char *content,
 	/* first, get the content length */
 	c = n->children;
 	while (c) {
-		if (c->type == XML_TEXT_NODE && !xmlIsBlankNode(c)) {
+		if ((c->type == XML_TEXT_NODE || c->type == XML_CDATA_SECTION_NODE)
+			&& !xmlIsBlankNode(c)) {
 			rlen += strlen((char*)c->content);
 		}
 		c = c->next;
@@ -244,7 +245,8 @@ int clish_xmlnode_get_content(clish_xmlnode_t *node, char *content,
 	if (rlen <= *contentlen) {
 		c = n->children;
 		while (c) {
-			if (c->type == XML_TEXT_NODE && !xmlIsBlankNode(c)) {
+			if ((c->type == XML_TEXT_NODE || c->type == XML_CDATA_SECTION_NODE)
+				 && !xmlIsBlankNode(c)) {
 				strcat(content, (char*)c->content);
 			}
 			c = c->next;