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

updateObject (target : xlink, newContent : nodeset) : boolean

After editing elements, the contents should be also saved. The method “updateObject” is provided for this.
This method saves changes to an existing object.

For the parameter “newContent”, an XML fragment is transferred which represents the type to be saved.

<xsl:stylesheet xmlns:app="http://onionworks.net/2006/data/application" xmlns:onion="http://onionworks.net/2004/schema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:variable name="content">
<post onion:schema="Onion:http://www.getit.de/2007/guestbook/post"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit </post>
</xsl:variable>
<xsl:if test="app:checkOut(c.id))">
<xsl:choose>
<xsl:when test="app:updateObject(c.id(), $content)"> The changes were saved successfuly.
<app:checkIn id="{c.id()}" />
</xsl:when>
<xsl:otherwise> The changes could not be saved.
<app:undoCheckOut id="{c.id()}" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Updating a guest book entry