Skip Menu |

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

Report information
The Basics
Id: 4204
Status: new
Priority: 0/
Queue: XML-Mini

People
Owner: Nobody in particular
Requestors: martin [...] run.montefiore.ulg.ac.be
Cc:
AdminCc:

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



Subject: XML::Mini may produces invalid XML documents.
XML-Mini-1.2.8 This is perl, v5.8.0 built for i586-linux-thread-multi Linux asmodan 2.4.20-4GB #1 Wed Apr 16 14:50:03 UTC 2003 i686 unknown nknown GNU/Linux While trying to update an existing document, by using [code] $mini->fromFile("myFile.xml"); $root=$mini->getRoot; # commands come here: $root->createChild('x')->text('y'); $mini->toFile("$document/.meta-document.xml",TRUE); [/code] XML::Mini::Document will produce invalid documents by reordering the '<?xml ... ?> header's attributes. Everything works fine as long as i just have '<?xml version="1.0"?>', but if i try to apply this code on a document that has '<?xml version="1.0" encoding="ISO-8859-1"?>', the generated document will have '<?xml encoding="ISO-8859-1" version="1.0"?>', which makes /xmllint/ tool complaint (as well as other tools like XML::XPath, for instance) MyFile.xml error: Malformed declaration expecting version <?xml encoding="ISO-8859-1" version="1.0"?> ^ MyFile.xml:1: error: Blank needed here <?xml encoding="ISO-8859-1" version="1.0"?> ^ MyFile.xml:1: error: parsing XML declaration: '?>' expected version="1.0"?> ^ haven't tried to patch yet, but i guess replacing a hash by a list somewhere would definitely help ...
[guest - Fri Oct 24 02:27:30 2003]: can be patched adding [code Element.pm@line 64] # pype -- fixing [cpan #4204] push @{$self->{'_attributes_ordered'}},$name if defined $self->{'_attributes_ordered'} and ! defined $self->{'_attributes'}->{$name}; # /pype [/code] [code Header.pm@line 20] # pype -- fixing [cpan #4204] $self->{'_attributes_ordered'} = []; # /pype [/code] and replacing [code] foreach my $atName (sort keys %{$self->{'_attributes'}}) [/code] with [code] foreach my $atName (@{$self->{'_attributes_ordered'}} [/code] at lines 46 and 72 of Header.pm