MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlAttrNormalizeSpace

Function xmlAttrNormalizeSpace

ThirdParty/libxml2/vtklibxml2/parser.c:1027–1047  ·  view source on GitHub ↗

* 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

Source from the content-addressed store, hash-verified

1025 * is needed.
1026 */
1027static xmlChar *
1028xmlAttrNormalizeSpace(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:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected