Initializing help system before first use

getname

Purpose
Get the name of a node.
Synopsis
function getname(doc:xmldoc, n:integer):string
Arguments
doc 
Document to use
Node number
Return value
The name of the node depending on the node type:
XML_ELT 
name of the element section
XML_TXT 
"#text"
XML_CDATA 
"#cdata-section"
XML_COM 
"#comment"
XML_DATA 
"#data"
XML_PINST 
processing instruction target
XML_ATTR 
name of the attribute
Example
The following example collects the names of all element nodes occurring in a document.
  declarations
    DB: xmldoc
    NodeList: list of integer
    NodeNames: set of string
  end-declarations

  getnodes(DB, "/descendant-or-self::node()", NodeList)
  NodeNames:= union(r in NodeList | gettype(DB,r)=XML_ELT) {getname(DB,r)}
  writeln("Names of element nodes: ", NodeNames) 
Further information
Only element, attribute and processing instruction nodes have a name, for all other node types the above listed constant name is returned.
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.