Package: libxml-mini-perl Version: 1.2.8-2 When trying to create a small xml document using the parameter $XML::Mini::NoWhiteSpaces, the function "toString" creates an invalid header. Instead of <?xml version="1.0"?>, it returns <? xmlversion="1.0"?>.
Attached to this bugreport, you will find an example program which proves the erratic behaviour, as well as a small patch to fix the problem. Regards Marc Laue
#! /usr/bin/perl use strict; use XML::Mini::Document; my $doc=XML::Mini::Document->new(); my $root=$doc->getRoot(); my $header=$root->prependChild(XML::Mini::Element::Header->new('xml')); $header->attribute('version','1.0'); print $doc->toString($XML::Mini::NoWhiteSpaces),"\n";
diff -ur libxml-mini-perl-1.2.8.orig/lib/XML/Mini/Element/Header.pm libxml-mini-perl-1.2.8/lib/XML/Mini/Element/Header.pm --- libxml-mini-perl-1.2.8.orig/lib/XML/Mini/Element/Header.pm 2003-01-26 08:44:01.000000000 +0000 +++ libxml-mini-perl-1.2.8/lib/XML/Mini/Element/Header.pm 2005-10-26 07:29:40.000000000 +0000 @@ -62,7 +62,7 @@ { my $self = shift; - my $retString = '<? ' . $self->name(); + my $retString = '<?' . $self->name() . ' '; my $attribString; foreach my $atName (sort keys %{$self->{'_attributes'}}) {