Initializing help system before first use

getvalue

Purpose
Get the value of a node.
Synopsis
function getvalue(doc:xmldoc, n:integer):text
function getboolvalue(doc:xmldoc, n:integer):boolean
function getintvalue(doc:xmldoc, n:integer):integer
function getrealvalue(doc:xmldoc, n:integer):real
function getstrvalue(doc:xmldoc, n:integer):string
Arguments
doc 
Document to use
Node number
Return value
The value of the node.
Example
This code prints out the name of the employee with attribute id="T345".
  declarations
    DB: xmldoc
  end-declarations

  writeln("Person with id='T345': ", getvalue(DB, getnode(DB,
    "personnelList/region/employee[@id='T345']/name") ))
 
Further information
1. Values of nodes are stored as text objects: the first version of the routine returns a reference to the object containing the value. Modifying this text will also alter the node value. Using one of the alternative versions of this routine allows to avoid having to perform a type conversion. Note however that no validation is performed and a conversion error will result in a 0 for a number and false for a Boolean without raising any error.
2. Element nodes have no value: the returned value corresponds to the value of the first child of type text of this element (or an empty string if no such child 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.