Initializing help system before first use

getnext

Purpose
Get the successor of a node.
Synopsis
function getnext(doc:xmldoc, n:integer):integer
Arguments
doc 
Document to use
Node number
Return value
The node number of the following node or -1 if the current node is the last of the list.
Example
This example enumerates all child nodes within a specific region and displays the 'id' for all 'employee' nodes on a single line, adding a line break after the last name:
  declarations
    DB: xmldoc
    APAC, Pers: integer
  end-declarations

  APAC:= getnode(DB, "personnelList/region[@id='APAC']")
  Pers:= getfirstchild(DB, APAC)
  LastPers:= getlastchild(DB, APAC)
  while(Pers>-1) do
    if getname(DB, Pers)="employee" then
      write(" ", getattr(DB,Pers,"id"))
    end-if
    if Pers=LastPers then writeln; end-if
    Pers:= getnext(DB, Pers)
  end-do 
Further information
Node numbers returned by Mosel are not directly related to the order of nodes within the XML document ( i.e. a larger node number does not imply that a node succeeds a node with a smaller number).
Related topics
Module

© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.