getnode
Purpose
Synopsis
function getnode(doc:xmldoc, n:integer, p:string|text):integer
function getnode(doc:xmldoc, n:integer):integer
function getnode(doc:xmldoc, p:string):integer
Arguments
|
doc
|
Document to use
|
|
n
|
Base node number (
0 when not provided)
|
|
p
|
Path to the node (
"*" when not provided)
|
Return value
The node number of the first node selected by the path
p;
-1 if no node can be found.
Example
The following example shows different forms of the
getnode function.
declarations
DB: xmldoc
Root, EMEA: integer
end-declarations
! Get the first element that is not a comment or a processing instruction
Root:= getnode(DB,"*") ! Same as: getnode(DB,0,"*")
! Get the 'region' node with id=EMEA
EMEA:= getnode(DB, "personnelList/region[@id='EMEA']")
! Check for employee record (node) for 'Sam' under 'EMEA'
if getnode(DB, EMEA, "employee/name[string()='Sam']/..")<0 then
writeln("No employee called 'Sam' in EMEA")
end-if
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 is the same as
getfirstchild when used without path specification.
Related topics
Module
© 2001-2022 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.
