D
David McBride
I'm getting the following message when I run my Perl script that uses
the XML::Writer module:
"Processing instruction target begins with 'xml' at
.../makeconf/LW/LWTest.pm line 75"
The pi() statement is almost identical to the example for the module
at cpan.org. In fact, I tried replacing my use with the example and
got the same result. Can anyone tell me why I'm getting this warning,
even though I'm getting the correct output?
Here is the code snippet where I'm using XML::Writer:
###BEGIN SNIP
my $output = new IO::File(">$out_file_path");
my $writer = new XML::Writer( OUTPUT => $output, DATA_MODE => 1,
DATA_INDENT => 4 );
$writer->xmlDecl( 'ISO-8859-1', 'yes' );
$writer->pi('xml-stylesheet', 'type="text/xsl" href="LW_Test.xsl"');
#line 75
$writer->startTag( 'testcase' );
$writer->dataElement( "name", $test_case_name);
$writer->dataElement( "timestamp", $test_case_timestamp);
$writer->dataElement( "overview", $test_case_overview);
foreach(@conditions) {
my $cond_id = LW::TestCondition->getConditionID($_);
my $cond_comp = LW::TestCondition->getConditionComp($_);
my $cond_pass_fail = LW::TestCondition->getConditionPassFail($_);
my $cond_pass_desc = LW::TestCondition->getConditionDesc($_);
my $cond_err_msg = LW::TestCondition->getConditionErrMsg($_);
$writer->startTag( 'condition', 'id' => $cond_id,
'completed' => $cond_comp,
'pass_fail' => $cond_pass_fail);
$writer->dataElement( "description", $cond_pass_desc);
$writer->dataElement( "err_msg", $cond_err_msg);
$writer->endTag( 'condition' );
}
$writer->endTag( 'testcase' );
###END SNIP
The output file looks like this (which is what I wanted):
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<?xml-stylesheet href="style.css" type="text/css"?>
<testcase>
<name>my test case</name>
<timestamp>Tue Sep 30 11:19:55 2003</timestamp>
<overview>text containing many wise and wonderful
things</overview>
<condition id="1" completed="yes" pass_fail="pass">
<description>this is the description for condition
1</description>
<err_msg>none</err_msg>
</condition>
<condition id="2" completed="no" pass_fail="fail">
<description>this is the description for condition
2</description>
<err_msg>condition 1 failed</err_msg>
</condition>
<condition id="3" completed="yes" pass_fail="pass">
<description>this is the description for condition
3</description>
<err_msg>none</err_msg>
</condition>
<condition id="4" completed="yes" pass_fail="fail">
<description>this is the description for condition
4</description>
<err_msg>files not the same</err_msg>
</condition>
</testcase>
the XML::Writer module:
"Processing instruction target begins with 'xml' at
.../makeconf/LW/LWTest.pm line 75"
The pi() statement is almost identical to the example for the module
at cpan.org. In fact, I tried replacing my use with the example and
got the same result. Can anyone tell me why I'm getting this warning,
even though I'm getting the correct output?
Here is the code snippet where I'm using XML::Writer:
###BEGIN SNIP
my $output = new IO::File(">$out_file_path");
my $writer = new XML::Writer( OUTPUT => $output, DATA_MODE => 1,
DATA_INDENT => 4 );
$writer->xmlDecl( 'ISO-8859-1', 'yes' );
$writer->pi('xml-stylesheet', 'type="text/xsl" href="LW_Test.xsl"');
#line 75
$writer->startTag( 'testcase' );
$writer->dataElement( "name", $test_case_name);
$writer->dataElement( "timestamp", $test_case_timestamp);
$writer->dataElement( "overview", $test_case_overview);
foreach(@conditions) {
my $cond_id = LW::TestCondition->getConditionID($_);
my $cond_comp = LW::TestCondition->getConditionComp($_);
my $cond_pass_fail = LW::TestCondition->getConditionPassFail($_);
my $cond_pass_desc = LW::TestCondition->getConditionDesc($_);
my $cond_err_msg = LW::TestCondition->getConditionErrMsg($_);
$writer->startTag( 'condition', 'id' => $cond_id,
'completed' => $cond_comp,
'pass_fail' => $cond_pass_fail);
$writer->dataElement( "description", $cond_pass_desc);
$writer->dataElement( "err_msg", $cond_err_msg);
$writer->endTag( 'condition' );
}
$writer->endTag( 'testcase' );
###END SNIP
The output file looks like this (which is what I wanted):
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<?xml-stylesheet href="style.css" type="text/css"?>
<testcase>
<name>my test case</name>
<timestamp>Tue Sep 30 11:19:55 2003</timestamp>
<overview>text containing many wise and wonderful
things</overview>
<condition id="1" completed="yes" pass_fail="pass">
<description>this is the description for condition
1</description>
<err_msg>none</err_msg>
</condition>
<condition id="2" completed="no" pass_fail="fail">
<description>this is the description for condition
2</description>
<err_msg>condition 1 failed</err_msg>
</condition>
<condition id="3" completed="yes" pass_fail="pass">
<description>this is the description for condition
3</description>
<err_msg>none</err_msg>
</condition>
<condition id="4" completed="yes" pass_fail="fail">
<description>this is the description for condition
4</description>
<err_msg>files not the same</err_msg>
</condition>
</testcase>