EasyCwmp

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000136easycwmp[All Projects] Enhancementpublic2016-05-17 16:312016-05-26 10:11
Reportermohamed.kallel 
Assigned Tomohamed.kallel 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionno change required 
PlatformOSOS Version
Summary0000136: use mxmlGetNextSibling() in xml_get_value_with_whitespace()
DescriptionAccording to an EasyCwmp contributor, it's better to use mxmlGetNextSibling() in
xml_get_value_with_whitespace() in this way:

char *xml_get_value_with_whitespace(mxml_node_t **b)
{
    //b is a TEXT and it is the first child in the ELEMENT
    //If a string has spaces, it is represented as multiple TEXT siblings.

    char * value = calloc(1, sizeof(char));
    do {
        value = realloc(value, strlen(value) + strlen((*b)->value.text.string) + 2);
 
        /*handle leading space before this string*/
        if ((*b)->value.text.whitespace == 1)
            strcat(value, " ");

        strcat(value, (*b)->value.text.string);

     } while ((*b = mxmlGetNextSibling(*b)) &&
                   (*b)->type == MXML_TEXT);
  return value;
}

attached test.c and test.xml
TagsNo tags attached.
Attached Filesc file icon test.c [^] (1,182 bytes) 2016-05-17 16:32
xml file icon test.xml [^] (79 bytes) 2016-05-17 16:32

- Relationships

-  Notes
(0000478)
mohamed.kallel (manager)
2016-05-26 10:11

this issue is uselss since the use of mxmlGetNextSibling() could cause many cases to take in account. So we keep the current solution for the moment

- Issue History
Date Modified Username Field Change
2016-05-17 16:31 mohamed.kallel New Issue
2016-05-17 16:32 mohamed.kallel File Added: test.c
2016-05-17 16:32 mohamed.kallel File Added: test.xml
2016-05-26 10:11 mohamed.kallel Note Added: 0000478
2016-05-26 10:11 mohamed.kallel Status new => resolved
2016-05-26 10:11 mohamed.kallel Resolution open => no change required
2016-05-26 10:11 mohamed.kallel Assigned To => mohamed.kallel


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker