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

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="http://onionworks.net/2006/data/application" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:onion="http://onionworks.net/2004/data" version="1.0">
<xsl:template match="/">
<xsl:choose>
<xsl:when test="app:setObjectPosition(c.id(), 0)"> The element is now on the first position. </xsl:when>
<xsl:otherwise> The element could not be positioned. </xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Positioning an element