YedXml - Delete_Element

NAME:
Delete_Element

SYNOPSIS:
SINT Delete_Element (void *pvO,SCHAR *pscKeyElement,SINT siNumElement);

DESCRIPTION:
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:

<node value="22">
  <child>child content
       <foo>tag foo</foo>
  
</child>
</node>


// Deleting the node 'child'

Delete_Element(this,"child",1);

// Now XML buffer is:

<node value="22">
</node>


// Deleting the node 'node'
Delete_Element(this,"node",1);

// The XML buffer is now empty

RETURN VALUE:
The method returns a value >= YPRSUCCESS if the new node has been correctly deleted. In case of error, it returns:

YPRINVALIDPARAM
One of input parameters is invalid.

YPRNOMEM
Memory unavailable to perform operation.

YPRINVALIDREM
XML buffer has comment tag ( '<!--' ) not properly closed.

YPRNOMORELEMENT
XML source buffer has no more elements to load. Although this case can seem normal, it shows a semantic problem in XML source buffer.

YPRNOCLOSE
Can't find closing bracket of XML element.

YPRLENINVALID
Try to copying buffer in a static memory area that cannot contain it. Expand the LEN_XML_STATIC_BUFFER constant and rebuild Yed.

YPRINVALIDVALUEATTR
Attribute value of an XML element is not between single or double quote.

YPRMISSINGTERM
Tag termination is expected but not found.

YPRNOBUFFER
Can't delete elements from an empty tree.

YPRNOTFOUND
Can't find the tag of element to delete.


http://yed.sourceforge.net