Subject: | NEWLINES functionality not working correctly |
When NEWLINES => 1 is added to the constructor of XML::Writer the
newlines are not put in the correct places. Below is a short example of
the output. I have also attached the full output and the script which
creates it.
Distribution Version : XML-Writer-0.603
Perl Version : v5.8.8
OS : MS Windows XP SP2
Thanks,
Subject: | Example.pl |
use strict;
use XML::Writer;
use IO::File;
my $jobID = 'Example';
my $jobSpec = new IO::File(">testfile.xml");
my $specWriter = new XML::Writer(OUTPUT => $jobSpec, NEWLINES => 1);
$specWriter->xmlDecl();
$specWriter->doctype("TFarmJob", "Manifest", "sanitytest.dtd");
$specWriter->startTag('TFarmJob', 'name' => $jobID);
$specWriter->startTag('TestSpec');
$specWriter->startTag('OS');
$specWriter->characters('x');
$specWriter->endTag('OS');
$specWriter->startTag('Platform');
$specWriter->characters('hrp');
$specWriter->endTag('Platform');
$specWriter->startTag('BuildNo');
$specWriter->characters('y');
$specWriter->endTag('BuildNo');
$specWriter->startTag('BuildMode');
$specWriter->characters('use');
$specWriter->endTag('BuildMode');
$specWriter->startTag('RomName');
$specWriter->characters('rom.zip');
$specWriter->endTag('RomName');
$specWriter->startTag('PackName');
$specWriter->characters('server');
$specWriter->endTag('PackName');
$specWriter->startTag('Release');
$specWriter->characters('urel');
$specWriter->endTag('Release');
$specWriter->dataElement('Install', 'type' => 'simple', 'loader' => 'serial');
$specWriter->dataElement('Reruns', 'number' => '0');
$specWriter->dataElement('Category', 'type' => 'san');
$specWriter->startTag('Capabilities');
$specWriter->dataElement('Srvcap', 'name' => 'HTEL');
$specWriter->endTag('Capabilities');
$specWriter->endTag('TestSpec');
$specWriter->endTag('TFarmJob');
$specWriter->end();
Subject: | testfile.xml |
<?xml version="1.0"?>
<!DOCTYPE TFarmJob PUBLIC "Manifest" "sanitytest.dtd">
<TFarmJob name="Example"
><TestSpec
><OS
>x</OS
><Platform
>hrp</Platform
><BuildNo
>y</BuildNo
><BuildMode
>use</BuildMode
><RomName
>rom.zip</RomName
><PackName
>server</PackName
><Release
>urel</Release
><Install serial="" simple="loader"
>type</Install
><Reruns
>number</Reruns
><Category san=""
>type</Category
><Capabilities
><Srvcap HTEL=""
>name</Srvcap
></Capabilities
></TestSpec
></TFarmJob
>