Establece el valor del elemento de sintaxis especificado.
void cpiSetElementValueValue( int* returnCode, CciElement* targetElement, CciElementValue* value);
Ninguno. Si se produce un error, returnCode indica la razón del mismo.
Este ejemplo se ha tomado del archivo de analizador de ejemplo BipSampPluginParser.c (líneas 675 a 698):
void cpiSetElementValue( CciParser* parser, CciElement* element, CciElementValue* value ){ CciElement* newElement; int rc; if ((cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_VALUE) || (cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_NAME_VALUE)) { cpiSetElementValueValue(&rc, element, value); } else if (cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_NAME) { /* Crear un elemento de valor nuevo, añadirlo como primer hijo y establecer el valor */ newElement = cpiCreateElement(&rc, parser); cpiSetElementType(&rc, newElement, CCI_ELEMENT_TYPE_VALUE); cpiSetElementValueValue(&rc, newElement, value); cpiAddAsFirstChild(&rc, element, newElement); } else { } return; }