Hello All,
I am trying to build a drop down list from an inline callout and get weird results.
The comma delimited list has 43 items but not all are returned to the drop down list.
Code starts here
#!c:/iw-home/iw-perl/bin/iwperl
my $fileToOpen = shift;
# $string = qq[<option value="$fileToOpen" label="$fileToOpen"/>];
open( FILEHANDLE, $fileToOpen ) or die ("Could not open file $fileToOpen");
undef $/; # enter slurp mode
my $inFile = <FILEHANDLE>;
close( FILEHANDLE );
my
@splitData = split( /\,/, $inFile );
$numElements = scalar(
@splitData);
$optionHTML = qq[<option label="$numElements">Num Elements</option>];
foreach $subject (
@splitData ) {
$subject = xc($subject);
$optionHTML .= qq[<option label="$subject">$subject</option>];
}
# produce output
print <<EOF;
<?xml version="1.0" encoding='UTF-8'?>
<substitution>
$optionHTML
</substitution>
EOF
#
sub xc {
#returns text free of XML baddies - xc = xml clean
my $data = $_[0];
$data =~ s/&/&/g;
$data =~ s/</</g;
$data =~ s/>/>/g;
$data =~ s/\'/'/g;
$data =~ s/\"/"/g;
return $data;
}
and the comma delimited list
About You,BCS Employee,Sales Recognition Events Framework,BPFJ+,Building Wealth,Community Program,Compensation,Employment Confirmations,Employee Development,Employee Services,Executive Development,Expense Reimbursement,Financial Benefits,Flexibility,Global Pulse Survey,Health Benefits,Hiring,HR Assist,IDP Tool,Insurance,Manager Services,Management Development,Mobility,New Hire Information,Other,PaylinkPlus,Payroll Services,PBC Tool - Urgent,PBC Tool - Normal,Peace of Mind Benefits,Personnel Records,Promotions,Reporting,Reporting - Data Quality & Integrity,Site Utilities,Single Cycle Salary Review,Transition Employees,Transactional,Well Being,When Life Changes,Workforce Diversity,Workplace Practices,Your Career
And the output from the DCT
Note the second element of the list has the count of the number of elements in the splitData array.
<DIV id="ctl26"><!-- Begin anotherContainer/Choose Page Subject-->
<select class='multiSelectStyle' name='anotherContainer/Choose Page Subject' size=1 onfocus='datacapture.handleElementSelect( 26);' onchange='parent.api.iw_dispatch_handleOnChange(26,this);'>
<option value="">
<option value="43"> 43
<option value="BCS Employee"> BCS Employee
<option value="BPFJ+"> BPFJ+
<option value="Community Program"> Community Program
<option value="Employment Confirmations"> Employment Confirmations
<option value="Employee Services"> Employee Services
<option value="Expense Reimbursement"> Expense Reimbursement
<option value="Flexibility"> Flexibility
<option value="Health Benefits"> Health Benefits
<option value="HR Assist"> HR Assist
<option value="Insurance"> Insurance
<option value="Management Development"> Management Development
<option value="New Hire Information"> New Hire Information
<option value="PaylinkPlus"> PaylinkPlus
<option value="PBC Tool - Urgent"> PBC Tool - Urgent
<option value="Peace of Mind Benefits"> Peace of Mind Benefits
<option value="Promotions"> Promotions
<option value="Reporting - Data Quality & Integrity"> Reporting - Data Quality & Integrity
<option value="Single Cycle Salary Review"> Single Cycle Salary Review
<option value="Transactional"> Transactional
<option value="When Life Changes"> When Life Changes
<option value="Workplace Practices"> Workplace Practices
</select>
<!-- End anotherContainer/Choose Page Subject-->
<!-- End DIV for ctl26-->
Any Help appreciated.
Thank You
Colin