#ifdef USE_LIBXML int lpc = 0; char ch = 0; int input_len = 0; gboolean more = TRUE; gboolean inTag = FALSE; crm_data_t *xml_object = NULL; const char *the_xml; xmlDocPtr doc; xmlBufferPtr xml_buffer = NULL;  if(input == NULL || (input_len = strlen(input)) < 0) { return NULL; }  xml_buffer = xmlBufferCreate();  for(lpc = 0; (lpc < input_len) && more; lpc++) { ch = input[lpc]; switch(ch) { case EOF: case 0: ch = 0; more = FALSE; xmlBufferAdd(xml_buffer, &ch, 1); break; case '>': case '<': inTag = TRUE; if(ch == '>') inTag = FALSE; xmlBufferAdd(xml_buffer, &ch, 1); break; case '\n': case '\t': case ' ': ch = ' '; if(inTag) { xmlBufferAdd(xml_buffer, &ch, 1); } break; default: xmlBufferAdd(xml_buffer, &ch, 1); break; } }   xmlInitParser(); the_xml = xmlBufferContent(xml_buffer); doc = xmlParseMemory(the_xml, strlen(the_xml)); xmlCleanupParser();  if (doc == NULL) { crm_err("Malformed XML [xml=%s]", the_xml); xmlBufferFree(xml_buffer); return NULL; }  xmlBufferFree(xml_buffer); xml_object = xmlDocGetRootElement(doc);  return xml_object; #else 
string2xml(const char *input){#ifdef USE_LIBXML	int lpc = 0;	char ch = 0;	int input_len = 0;	gboolean more = TRUE;	gboolean inTag = FALSE;	crm_data_t *xml_object = NULL;	const char *the_xml;	xmlDocPtr doc;	xmlBufferPtr xml_buffer = NULL;	if(input == NULL || (input_len = strlen(input)) < 0) {		return NULL;	}		xml_buffer = xmlBufferCreate();		for(lpc = 0; (lpc < input_len) && more; lpc++) {		ch = input[lpc];		switch(ch) {			case EOF: 			case 0:				ch = 0;				more = FALSE; 				xmlBufferAdd(xml_buffer, &ch, 1);				break;			case '>':			case '<':				inTag = TRUE;				if(ch == '>') inTag = FALSE;				xmlBufferAdd(xml_buffer, &ch, 1);				break;			case '\n':			case '\t':			case ' ':				ch = ' ';				if(inTag) {					xmlBufferAdd(xml_buffer, &ch, 1);				} 				break;			default:				xmlBufferAdd(xml_buffer, &ch, 1);				break;		}	}		xmlInitParser();	the_xml = xmlBufferContent(xml_buffer);	doc = xmlParseMemory(the_xml, strlen(the_xml));	xmlCleanupParser();	if (doc == NULL) {		crm_err("Malformed XML [xml=%s]", the_xml);		xmlBufferFree(xml_buffer);		return NULL;	}	xmlBufferFree(xml_buffer);	xml_object = xmlDocGetRootElement(doc);	return xml_object;#else	crm_data_t *output = parse_xml(input, NULL);	if(output != NULL) {		crm_update_parents(output);		crm_validate_data(output);	}	return output;#endif	}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/50d05afdbc8743d6b8079541c4592c1bd0365dad/xml.c/buggy/lib/crm/common/xml.c