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

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

After working on elements, the contents should also be 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:onion="http://onionworks.net/2004/schema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:edit="http://onionworks.net/2006/data/editing" 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="edit:login('testuser', 'test')">
<xsl:choose>
<xsl:when test="edit:updateObject(c.id(), $content)"> The changes were saved. </xsl:when>
<xsl:otherwise>The changes could not be saved.</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="edit:logout()" />
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Updating a document