project BLF > class Database Component > method HandleSuppressEmptyFields
Description
Method that is called recursively to handle the suppress emtpy fields option of DumpXmlRepresentation.
Parameters
ihParent | input | handle | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
BLF
program code (program4/database.p)
CREATE X-NODEREF vhnode in widget-pool "non-persistent".
DO vicount = 1 TO ihparent:NUM-CHILDREN:
ihparent:GET-CHILD(vhnode,vicount).
IF vhnode:NAME = "#text":U AND
TRIM(vhnode:node-value) = ""
THEN DO:
ihparent:REMOVE-CHILD(vhnode).
vicount = vicount - 1.
NEXT.
END.
<M-1 run HandleSuppressEmptyFields
(input vhNode (ihParent),
output oiReturnStatus (oiReturnStatus)) in database>
IF TRIM(vhnode:node-value) = "" AND
vhnode:NUM-CHILDREN = 0
THEN DO:
ihparent:REMOVE-CHILD(vhnode).
vicount = vicount - 1.
END.
END.
finally:
DELETE OBJECT vhnode.
end finally.