# checks an accessor string and all it's childen to see if it contains any data entries.# iterates through an accessor discovering new nodes. If all nodes contain no/empty data - routine will return 0 (false)# if any nodes contain data, the routine will stop, returning 1 true# takes in an iwov accessor string ($node) in the same format that iwpt_dcr_list/iwpt_dcr_value accepts# one specific function# Can be used in perl or iw tags# EG # if (¬Empty('dcr.someField') {# iwpt_output('dcr.someField');# }# <iw_if expr='notEmpty('dcr.Cardselect.Simpleoverview.overview')>sub notEmpty { my ($node) = @_; my ($iterator, $field); foreach $iterator (iwpt_dcr_list($node)) { foreach (iwpt_dcr_list('iterator.*')) { if ($_->type() eq 'CDATA') { $field = iwpt_dcr_value($node); if ((defined $field) && ($field !~ m/^\s*$/)) { # field is not empty - no need to continue return 1; } } else { if (¬Empty($node . '.' . $_->type())) { return 1; } } } } return 0;}