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

Elements can be moved within the structure. An element can change its position within its own hierarchy level with the method “setObjectPostion”.

The parameter “position” specifies where the element is to be situated in the level. “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:app="" xmlns:xsl="" xmlns:onion="" version="1.0">
<xsl:template match="/">
<xsl:when test="app:setObjectPosition(, 0)"> The element is now on the first position. </xsl:when>
<xsl:otherwise> The element could not be positioned. </xsl:otherwise>
Positioning an element