setObjectPosition (target : xlink, position : int) : boolean

Elements can be moved within the structure. With the method “setObjectPostion”, an element can change position in its own hierarchy level.

The parameter position indicates where in the level the element is to be situated. “n-1” is to always be specified for the position. That means if an element is to move into first position, then a zero must be specified. In the same way, three would have to be specified for moving an element into final position in the case of four elements.

If the element has been successfully positioned, then “true” is returned. If it has not been positioned, say for example due to an invalid position indication, then “false” is returned.

The element can only be moved in the current hierarchy level. “moveObject” must be used for moving elements into other levels.

<xsl:stylesheet xmlns:xsl="" xmlns:edit="" xmlns:onion="" version="1.0">
<xsl:template match="/">
<xsl:if test="edit:login('testuser', 'test')">
<xsl:when test="edit:setObjectPosition(, 0)">The document was moved.</xsl:when>
<xsl:otherwise>The document could not be moved.</xsl:otherwise>
<xsl:value-of select="edit:logout()" />
Positioning an element