addnode
function addnode(doc:xmldoc, n:integer, where:integer, type:integer, name:string, value:text):integer
function addnode(doc:xmldoc, n:integer, where:integer, type:integer, nameval:string|text):integer
function addnode(doc:xmldoc, n:integer, type:integer, name:string, value:text):integer
function addnode(doc:xmldoc, n:integer, type:integer, nameval:string|text):integer
function addnode(doc:xmldoc, n:integer, type:integer):integer
function addnode(doc:xmldoc, n:integer, name:string, value:text|string|boolean|integer|real):integer
doc
|
Document to use
|
||||||||||||
n
|
Node number where to attach the new node
|
||||||||||||
where
|
How to attach the new node to the node
n:
When the function is used without this parameter,
XML_LASTCHILD is assumed.
|
||||||||||||
type
|
Type of node to add:
When the function is used without this parameter,
XML_ELT is assumed.
|
||||||||||||
name
|
Name associated to the new node. Only
element and
processing instruction nodes have a name
|
||||||||||||
value
|
Value associated to the new node. An
element node does not have any value: if this parameter is provided for a node of this type, an additional
text node with the specified value is added as the first child of the new node
|
||||||||||||
nameval
|
If the type is
XML_ELT or
XML_PINST this parameter is used as the name of this node. Otherwise it is the value of the new node
|
declarations DB: xmldoc APAC, NewPers, n, k: integer end-declarations APAC:= getnode(DB, "personnelList/region[@id='APAC']") ! Append a new node to 'APAC' and set its attribute 'id': NewPers:= addnode(DB, APAC, XML_LASTCHILD, XML_ELT, "employee") setattr(DB, NewPers, "id", "T432") ! Create a comment: n:= addnode(DB, NewPers, XML_COM, "This is a new employee") ! Add 2 nodes containing the specified text (nodes): n:= addnode(DB, NewPers, XML_ELT, "startDate", text(2012)) n:= addnode(DB, NewPers, XML_ELT, "name", "Tim") ! Add an empty node, then set its contents: n:= addnode(DB, NewPers, XML_ELT, "address") setvalue(DB, n, "Sydney") ! Add an empty node, then create its contents as a text node: n:= addnode(DB, NewPers, XML_ELT, "language") k:= addnode(DB, n, XML_TXT, "English")
<employee id="T432"> <!--This is a new employee--> <startDate>2012</startDate> <name>Tim</name> <address>Sydney</address> <language>English</language> </employee>
© 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.