summaryrefslogtreecommitdiff
path: root/plugin/business/tsg-http/src/edit_element.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/business/tsg-http/src/edit_element.cpp')
-rw-r--r--plugin/business/tsg-http/src/edit_element.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/plugin/business/tsg-http/src/edit_element.cpp b/plugin/business/tsg-http/src/edit_element.cpp
index b77d544..03f3ed0 100644
--- a/plugin/business/tsg-http/src/edit_element.cpp
+++ b/plugin/business/tsg-http/src/edit_element.cpp
@@ -35,7 +35,7 @@ enum search_scope scope_name_to_id(const char * name)
return (enum search_scope) i;
}
-int match_start_indicator(xmlNodePtr parent, char * start_indicator)
+int match_start_indicator(xmlNodePtr parent, char * start_indicator, int debug_for_log)
{
if(parent->properties == NULL)
{
@@ -43,6 +43,7 @@ int match_start_indicator(xmlNodePtr parent, char * start_indicator)
{
return 0;
}
+ if(debug_for_log == 1) printf(" start indicator, parent name: %s\n", parent->name);
if(!strcasecmp((char *)parent->name, start_indicator))
{
return 1;
@@ -57,6 +58,7 @@ int match_start_indicator(xmlNodePtr parent, char * start_indicator)
}
xmlNodePtr children = properties->children;
+ if(debug_for_log == 1) printf(" start indicator, children content: %s\n", children->content);
if(!strcasecmp((char *)children->content, start_indicator))
{
return 1;
@@ -130,6 +132,10 @@ int construct_cjson_by_treatment(cJSON *a_element, char **node, int *step, int *
{
if(a_element->type == cJSON_Object)
{
+ if(*node != NULL && rules->debug_for_log == 1)
+ {
+ printf(" start indicator: %s\n", *node);
+ }
if(*node != NULL && strcasecmp(*node, start_indicator) != 0)
{
return -2;
@@ -137,6 +143,10 @@ int construct_cjson_by_treatment(cJSON *a_element, char **node, int *step, int *
}
if(a_element->type == cJSON_Array)
{
+ if(a_element->string != NULL && rules->debug_for_log == 1)
+ {
+ printf(" start indicator: %s\n", a_element->string);
+ }
if(a_element->string != NULL && strcasecmp(a_element->string, start_indicator))
{
return -2;
@@ -165,6 +175,10 @@ int construct_cjson_by_treatment(cJSON *a_element, char **node, int *step, int *
{
if(a_element->type == cJSON_Object)
{
+ if(*node != NULL && rules->debug_for_log == 1)
+ {
+ printf(" start indicator: %s\n", *node);
+ }
if(*node != NULL && strcasecmp(*node, start_indicator) != 0)
{
return -2;
@@ -172,6 +186,10 @@ int construct_cjson_by_treatment(cJSON *a_element, char **node, int *step, int *
}
if(a_element->type == cJSON_Array)
{
+ if(a_element->string != NULL && rules->debug_for_log == 1)
+ {
+ printf(" start indicator: %s\n", a_element->string);
+ }
if(a_element->string != NULL && strcasecmp(a_element->string, start_indicator))
{
return -2;
@@ -231,6 +249,7 @@ int construct_html_by_treatment(const struct edit_element_rule * rules, xmlNodeP
char * start_indicator = rules->start_indicator;
const char *element_treatment=rules->element_treatment;
+ int debug_for_log = rules->debug_for_log;
int distane_from_matching = (rules->distane_from_matching + 1);
if(element_treatment != NULL && !strcasecmp(element_treatment, "mark"))
@@ -241,7 +260,7 @@ int construct_html_by_treatment(const struct edit_element_rule * rules, xmlNodeP
{
if(k == distane_from_matching)
{
- if (rules->scope == kScopeInside && match_start_indicator(parent, start_indicator) == 0)
+ if (rules->scope == kScopeInside && match_start_indicator(parent, start_indicator, debug_for_log) == 0)
{
break;
}
@@ -263,7 +282,7 @@ int construct_html_by_treatment(const struct edit_element_rule * rules, xmlNodeP
{
if(k == distane_from_matching)
{
- if (rules->scope == kScopeInside && match_start_indicator(parent, start_indicator) == 0)
+ if (rules->scope == kScopeInside && match_start_indicator(parent, start_indicator, debug_for_log) == 0)
{
break;
}