Skip Menu |

This queue is for tickets about the XML-Writer CPAN distribution.

Report information
The Basics
Id: 32947
Status: rejected
Priority: 0/
Queue: XML-Writer

People
Owner: Nobody in particular
Requestors: brendan.donegan [...] symbian.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



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 >
From: joe [...] kafsemo.org
On Tue Feb 05 12:54:10 2008, bdonegan wrote: Show quoted text
> 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.
It may be an unusual option, but I believe it's behaving as documented: Show quoted text
> if this parameter is present and its > value is true, then the module will insert an extra newline > before the closing delimiter of start, end, and empty tags
and putting a newline before the closing '>' of tags without adding extra white space to the document's text. DATA_MODE may suit your needs. Otherwise, can you be more specific about the output you would expect?