YedXml - Delete_Element
SINT Delete_Element (void *pvO,SCHAR *pscKeyElement,SINT siNumElement);
The method deletes from the XML internal tree of object instance pvO the XML element having tag value equal to the content of buffer pscKeyElement. siNumElement is the 1-based number of occurrence of pscKeyElement tag into XML internal tree, to find for deleting the node. Read Find_Element documentation for major details about searching for a tag into the tree through these couple of parameters. The method deletes an element and all its children from the tree; if the element to delete is the root element, the entire tree is released.
A few examples:
// Starting XML buffer is:
// Deleting the node 'child'
// Now XML buffer is:
// Deleting the node 'node'
// The XML buffer is now empty
The method returns a value >= YPRSUCCESS if the new node has been correctly deleted. In case of error, it returns:
One of input parameters is invalid.
Memory unavailable to perform operation.
XML buffer has comment tag ( '<!--' ) not properly closed.
XML source buffer has no more elements to load. Although this case can seem normal, it shows a semantic problem in XML source buffer.
Can't find closing bracket of XML element.
Try to copying buffer in a static memory area that cannot contain it. Expand the LEN_XML_STATIC_BUFFER constant and rebuild Yed.
Attribute value of an XML element is not between single or double quote.
Tag termination is expected but not found.
Can't delete elements from an empty tree.
Can't find the tag of element to delete.