getname
getname |
Purpose
Synopsis
function getname(doc:xmldoc, n:integer):string
Arguments
doc
|
Document to use
|
n
|
Node number
|
Return value
The name of the node depending on the node type:
XML_ELT
|
|
XML_TXT
|
|
XML_CDATA
|
|
XML_COM
|
|
XML_DATA
|
|
XML_PINST
|
|
XML_ATTR
|
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