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

createObject (target : xlink, name : string, content : nodeset, [autoCheckIn : boolean]) : string

“createObject” is used if new datasets are to be added to the content. For example, new entries can be added to a guest book in this way.

The following example shows how such an entry can be made:

<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:if test="edit:createObject(c.id(), 'Testeintrag', $content)"> The entry was saved. </xsl:if>
<xsl:value-of select="edit:logout()" />
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Adding a guest book entry

The content of the new element is transferred to the method as the third parameter in the form of an XML fragment. The schema describing this fragment must be specified in the root element of the fragment.

If the optional parameter “autoCheckIn” is not set, then the default value is “true”.