Gidday All,
I wish to parse a dcr to generate a drop down selection list for inclusion in a dct.
I assume the file path is correct as I have built another cgi-callout that retrieves a list of dcr's from a particular directory and displays these as a drop down selection list.
This is the first time I have done this.
This is the content of the cgi-callout I am writing.
#!c:/iw-home/iw-perl/bin/iwperl
# cj_tigetitems.ipl
use TeamSite:

CRnode;
my $xml_string = qq[y:/default/main/aphrweb/testbranch/WORKAREA/wa/templatedata/TopicIndexPages/TopicMaster/data/topicmaster.dcr];
$rootnode = TeamSite:

CRnode->new($xml_string);
my
@arrayTemp = ();
my
@columnId = ();
$columnId[1] = "Column 1";
$columnId[2] = "Column 2";
$columnId[3] = "Column 3";
$columnId[4] = "Column 4";
for( 1 .. 4 ){
$heading = $rootnode->value("Content Layout.$columnId[$_].DCR to Load.Heading");
if($heading eq ""){
$heading = $city;
}
$htmlOUT = qq[<option value="$heading" label="$heading"/>];
push (
@arrayTemp, $htmlOUT);
}
# produce output
print <<EOF;
<?xml version="1.0" encoding='UTF-8'?>
<substitution>
@arrayTemp</substitution>
EOF
#
now I know my code works because when I substitute the following string for the file path above it works !
(this was derived from the dcr I am trying to access above).
my $xml =<<'EOS';
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE record SYSTEM "dcr4.5.dtd">
<record name="test99">
<item name="Document properties">
<item name="Content Headers">
<value>
<item name="Page: Topics by category">
<value>
<item name="Heading">
<value>All Topics Index</value>
</item>
<item name="Text 2">
<value>Choose from our list of topics</value>
</item>
<item name="Text 3">
<value>View all topics u[Alphabetically;ti_alpha.html]. </value>
</item>
</value>
</item>
<item name="Page: Topics listed alphabetically">
<value>
<item name="Heading">
<value>All Topics - Alphabetical Index</value>
</item>
<item name="Text 2">
<value>Choose from our list of topics</value>
</item>
<item name="Text 3">
<value>View all topics by u[Category;ti_bycat.html].</value>
</item>
</value>
</item>
</value>
</item>
<item name="Content Layout">
<value>
<item name="Column 1">
<value>
<item name="DCR to Load">
<value>
<item name="Heading">
<value>Your Money</value>
</item>
<item name="DCR NAME">
<value>y:/default/main/aphrweb/testbranch/WORKAREA/wa/templatedata/TopicIndexPages/CategoryMaster/data/yourmoney</value>
</item>
</value>
</item>
</value>
</item>
<item name="Column 2">
<value>
<item name="DCR to Load">
<value>
<item name="Heading">
<value>Your Health</value>
</item>
<item name="DCR NAME">
<value>y:/default/main/aphrweb/testbranch/WORKAREA/wa/templatedata/TopicIndexPages/CategoryMaster/data/yourhealth</value>
</item>
</value>
<value>
<item name="Heading">
<value>Site Utilities</value>
</item>
<item name="DCR NAME">
<value>y:/default/main/aphrweb/testbranch/WORKAREA/wa/templatedata/TopicIndexPages/CategoryMaster/data/siteutilities</value>
</item>
</value>
</item>
</value>
</item>
<item name="Column 3">
<value>
<item name="DCR to Load">
<value>
<item name="Heading">
<value>Your Life</value>
</item>
<item name="DCR NAME">
<value>y:/default/main/aphrweb/testbranch/WORKAREA/wa/templatedata/TopicIndexPages/CategoryMaster/data/yourlife</value>
</item>
</value>
<value>
<item name="Heading">
<value>Manager Services</value>
</item>
<item name="DCR NAME">
<value>y:/default/main/aphrweb/testbranch/WORKAREA/wa/templatedata/TopicIndexPages/CategoryMaster/data/managerservices</value>
</item>
</value>
</item>
</value>
</item>
<item name="Column 4">
<value>
<item name="DCR to Load">
<value>
<item name="Heading">
<value>Your Career</value>
</item>
<item name="DCR NAME">
<value>y:/default/main/aphrweb/testbranch/WORKAREA/wa/templatedata/TopicIndexPages/CategoryMaster/data/yourcareer</value>
</item>
</value>
</item>
</value>
</item>
</value>
</item>
</item>
</record>
EOS
#