Initializing help system before first use

getnodes

Purpose
Get the list of nodes returned by a path specification.
Synopsis
procedure getnodes(doc:xmldoc, n:integer, p:string|text, l:list of integer)
procedure getnodes(doc:xmldoc, p:string, l:list of integer)
procedure getnodes(doc:xmldoc, n:integer, l:list of integer)
Arguments
doc 
Document to use
Base node number ( 0 when not provided)
Path to the node ( "*" when not provided)
List where result is returned
Example
Here are a number of examples how to retrieve nodes with specific properties:
  declarations
    DB: xmldoc
    Employees, AllEmployees: list of integer
  end-declarations

! Get all employees in the Americas
  getnodes(DB, "personnelList/region[@id='AM']/employee", Employees)

! All employees who started before 2005
  getnodes(DB, "personnelList/region/employee/startDate[number()<2005]/..",
    Employees)

! All employees whose names start with "J"
  getnodes(DB, "personnelList/region/employee", AllEmployees)
  forall(n in AllEmployees) do
    getnodes(DB, n, "./name[starts-with(string(),'J')]/..", Employees)
    forall(p in Employees) save(DB, p, "")
  end-do

! Employees speaking at least 3 languages (=have a third "language" entry)
  getnodes(DB, "personnelList/region/employee/language[position()=3]/..",
    Employees) 
Further information
1. Refer to section Paths in a document for a detailed description of the syntax and semantic of XML paths.
2. This function resets the list it receives as parameter: the provided list is returned empty if no node can be found.
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.