/[webpac]/branches/hidra/all2xml.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /branches/hidra/all2xml.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 744 by dpavlin, Wed May 24 19:08:35 2006 UTC revision 745 by dpavlin, Tue Jun 6 12:22:52 2006 UTC
# Line 76  my $use_lhash_cache = 1; Line 76  my $use_lhash_cache = 1;
76    
77  my $last_field_name;    # cache to prevent repeated fields  my $last_field_name;    # cache to prevent repeated fields
78    
79    my $broken_cdata = XMLin('<foo><![CDATA[<bar>]]></foo>') eq '<bar>>';
80    warn "XML::Simple on this system seems broken with <![CDATA[..]]>.\n" if ($broken_cdata);
81    
82  sub data2xml {  sub data2xml {
83    
84          use xmlify;          use xmlify;
# Line 207  sub data2xml { Line 210  sub data2xml {
210                          delete $x->{value};                          delete $x->{value};
211                          delete $x->{delimiter};                          delete $x->{delimiter};
212                          $x->{content} = $v;                          $x->{content} = $v;
213                            $d =~ s#>$## if ($d && $broken_cdata);
214                          $x->{delimiter} = $d;                          $x->{delimiter} = $d;
215                  }                  }
216                  return $x;                  return $x;
# Line 706  foreach my $database ($cfg->Sections) { Line 710  foreach my $database ($cfg->Sections) {
710          $config=XMLin($import_xml_file, ForceArray => [ $tag, 'config', 'format' ], ForceContent => 1 );          $config=XMLin($import_xml_file, ForceArray => [ $tag, 'config', 'format' ], ForceContent => 1 );
711    
712          # check for broken XML::Simple          # check for broken XML::Simple
713          if ( XMLin('<foo><![CDATA[<bar>]]></foo>') eq '<bar>>' ) {          if ( $broken_cdata ) {
                 warn "XML::Simple on this system seems broken with <![CDATA[..]]>.\n";  
714                  map {                  map {
715                          $config->{format}->{$_}->{content} =~ s#>$##;                          $config->{format}->{$_}->{content} =~ s#>$##;
716                  } keys %{ $config->{format} };                  } keys %{ $config->{format} };

Legend:
Removed from v.744  
changed lines
  Added in v.745

  ViewVC Help
Powered by ViewVC 1.1.26