By default this function reduces all last empty items from the first argument and returns it, but supplyed a second argument it also replaces the first item of the first argument by the second argument, but does not commit the return.
| SQLState | Error Code | Error Text | Description |
|---|---|---|---|
| 22003 | SR347 | Too few arguments for xte_nodebld_final | |
| 22003 | SR348 | The first argument of xte_node_nodebld_final is not made by xte_nodebld_init() function |
Before the xte_nodebld_final() call the length of the vector acc is equal to 16, after the call the length is 3. The vector acc does not correspond to a xml document - there is no a root tag. The result of the xte_nodebld_final() may be used as argument for xte_node_from_nodebld() to get a vector corresponding to complete xml document.
create procedure test1_nodebld()
{
declare acc any;
xte_nodebld_init (acc);
xte_nodebld_acc (acc,'string1', string2');
xte_nodebld_acc(acc, 'string3',xte_node(xte_head ('supplier', 'CompanyName','Seller')));
acc:=xte_nodebld_final(acc);
. . .
}
The vector acc below is corresponding to the following XML element:
<product>string1string2string3
<supplier CompanyName="Seller"></supplier>
</product>
create procedure test2_nodebld()
{
declare acc any;
declare "Res" any;
declare "ResLen" integer;
result_names ("ResLen", "Res");
xte_nodebld_init (acc);
xte_nodebld_acc (acc,'string1', 'string2');
xte_nodebld_acc(acc, 'string3',xte_node(xte_head ('supplier', 'CompanyName','Seller')));
xte_nodebld_final(acc, xte_head('product'));
result (length(acc), xml_tree_doc (acc));
}
test_nodebld()
ResLen Res
INTEGER VARCHAR
_______________________________________________________________________________
3 <product>string1string2string3<supplier CompanyName="Seller" /></product>