http://onionworks.net/2006/data/application

deleteObject (target : xlink, [recursive : boolean]) : boolean

The method “deleteObject()” deletes elements from the structure. For the parameter “xlink”, the XLink of the element to be deleted is specified. If the element to be deleted has child elements, then “recursive” must be specified.

The parameter “recursive” implicitly holds the value “false()”. If “recursive” is therefore not specified or is specified with the value “false()”, it is assumed that the element to be deleted does not have any child elements. If there are child elements however, then the element cannot be deleted. The method then returns “false”.

<xsl:stylesheet xmlns:app="http://onionworks.net/2006/data/application" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:onion="http://onionworks.net/2004/data" version="1.0">
<xsl:template match="/">
<xsl:if test="app:deleteObject(c.id(), true())">
<xsl:value-of select="'The element and his children were deleted successfuly.'" />
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Deleting document

In the example, the object is deleted on which the method is called. If it cannot be said for sure that the object has no children, the parameter “recursive” should be specified with “true()” as in the example.