| 581 | } |
| 582 | |
| 583 | static void writeNameValuePair(FILE *stream, int indent, const char *name, const char *value) { |
| 584 | char *string_tmp; |
| 585 | if(!name || !value) return; |
| 586 | writeIndent(stream, ++indent); |
| 587 | |
| 588 | if ( (strchr(name, '\'') == NULL) && (strchr(name, '\"') == NULL)) |
| 589 | fprintf(stream, "\"%s\"\t", name); |
| 590 | else if ( (strchr(name, '\"') != NULL) && (strchr(name, '\'') == NULL)) |
| 591 | fprintf(stream, "'%s'\t", name); |
| 592 | else if ( (strchr(name, '\'') != NULL) && (strchr(name, '\"') == NULL)) |
| 593 | fprintf(stream, "\"%s\"\t", name); |
| 594 | else { |
| 595 | string_tmp = msStringEscape(name); |
| 596 | fprintf(stream, "\"%s\"\t", string_tmp); |
| 597 | free(string_tmp); |
| 598 | } |
| 599 | |
| 600 | if ( (strchr(value, '\'') == NULL) && (strchr(value, '\"') == NULL)) |
| 601 | fprintf(stream, "\"%s\"\n", value); |
| 602 | else if ( (strchr(value, '\"') != NULL) && (strchr(value, '\'') == NULL)) |
| 603 | fprintf(stream, "'%s'\n", value); |
| 604 | else if ( (strchr(value, '\'') != NULL) && (strchr(value, '\"') == NULL)) |
| 605 | fprintf(stream, "\"%s\"\n", value); |
| 606 | else { |
| 607 | string_tmp = msStringEscape(value); |
| 608 | fprintf(stream, "\"%s\"\n", string_tmp); |
| 609 | free(string_tmp); |
| 610 | } |
| 611 | } |
| 612 | |
| 613 | static void writeAttributeBinding(FILE *stream, int indent, const char *name, attributeBindingObj *binding) { |
| 614 | if(!binding || !binding->item) return; |
no test coverage detected