* xmlAttrNormalizeSpace: * @src: the source string * @dst: the target string * * Normalize the space in non CDATA attribute values: * If the attribute type is not CDATA, then the XML processor MUST further * process the normalized attribute value by discarding any leading and * trailing space (#x20) characters, and by replacing sequences of space * (#x20) characters by a single space (#x20
| 1025 | * is needed. |
| 1026 | */ |
| 1027 | static xmlChar * |
| 1028 | xmlAttrNormalizeSpace(const xmlChar *src, xmlChar *dst) |
| 1029 | { |
| 1030 | if ((src == NULL) || (dst == NULL)) |
| 1031 | return(NULL); |
| 1032 | |
| 1033 | while (*src == 0x20) src++; |
| 1034 | while (*src != 0) { |
| 1035 | if (*src == 0x20) { |
| 1036 | while (*src == 0x20) src++; |
| 1037 | if (*src != 0) |
| 1038 | *dst++ = 0x20; |
| 1039 | } else { |
| 1040 | *dst++ = *src++; |
| 1041 | } |
| 1042 | } |
| 1043 | *dst = 0; |
| 1044 | if (dst == src) |
| 1045 | return(NULL); |
| 1046 | return(dst); |
| 1047 | } |
| 1048 | |
| 1049 | /** |
| 1050 | * xmlAddDefAttrs: |
no outgoing calls
no test coverage detected