MoveToNode Method (XDATA)


9.8A

 

The MoveToNode method sets the current node position specified by the {position} value. The method uses the following format:

 

[label]

{object}.MoveToNode

[GIVING {return}] using *Position={position}

 

Where:

label
Optional. A Program Execution Label.
object
Required. An XDATA object.
return
Optional. A Numeric Variable that receives a value to signify a pass or fail condition for the method execution.
position
Required. A Numeric Variable or decimal number that specifies the position in the node tree where the current node is set.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. The ZERO flag is set if the {return} value is zero.

  2. The OVER flag is set TRUE if the {return} variable is too small where the returned value is truncated.

  3. The EOS flag is always cleared.

  4. The {position} values can be specified in one of three formats as follows:

  5.  

    1. Static Defined Position Values

    2.  

      Keyword

      Value

      MOVE_CURRENT_NODE

      0

      MOVE_PARENT_NODE

      1

      MOVE_FIRST_CHILD

      2

      MOVE_PREVIOUS_SIBLING

      4

      MOVE_NEXT_SIBLING

      5

      MOVE_DOCUMENT_NODE

      6

       

    3. GetPosition Direct Values

    4.  

      The {return} position value from the 'GetPosition' method identifies a unique number assigned to each node in the node tree. This 'GetPosition' value can be used in the MoveToNode {position} to position directly to a node in the node tree.

       

    5. Combined Pre-Defined Plus GetPosition Direct Values

    6.  

      In this case, the MoveToNode operation is performed in two steps as follows:

       

      1) The first step is to use the <getposition value> to position directly to a node.

       

      2) The second step is to use the <static> position value to perform the final positioning action starting from the position in the first step.

      Example:

       

      {position} = <getposition value> + <static>

       

  6. The {return} value is a zero if the method execution is successful. Otherwise, a non-zero value is returned to indicate an error has occurred. See the XDATA Method Return Values for more details.

  7. This method can return these values:

  8.  

    Value

    Meaning

    0

    XDATA_ERR_NONE (Success)

    2

    XDATA_ERR_INVALID_POSITION_TYPE

    4

    XDATA_ERR_NODE_NOT_FOUND

    11

    XDATA_ERR_INVALID_POSITION

 

 

See Also: XDATA, XDATA Methods, Method Syntax



PL/B Language Reference LoadXml Method (XDATA) Reset Method (XDATA)