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

The method “createObject()” is used to produce new data objects. 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:app="" xmlns:onion="" xmlns:xsl="" version="1.0">
<xsl:template match="/">
<xsl:variable name="parent">onion://data/objects/1</xsl:variable>
<xsl:variable name="name">Max Mustermann</xsl:variable>
<xsl:variable name="content">
<post onion:schema="Onion:"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit </post>
<xsl:when test="string-length(app:createObject($parent, $name, $content)) > 0"> The entry was saved. </xsl:when>
<xsl:otherwise> The entry could not be saved. </xsl:otherwise>
Adding a guest book entry

For the parameter xlink, the XLink of the element is specified under which the new object is to be created.

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”.