fix broken XML::Simple with <![CDATA[..]]>
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 24 May 2006 19:08:35 +0000 (19:08 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 24 May 2006 19:08:35 +0000 (19:08 +0000)
git-svn-id: file:///home/dpavlin/private/svn/webpac/branches/hidra@743 13eb9ef6-21d5-0310-b721-a9d68796d827

all2xml.pl

index 6d593f4..6ff09a8 100755 (executable)
@@ -705,6 +705,14 @@ foreach my $database ($cfg->Sections) {
        my $tag = $cfg->val($database, 'import_xml_tag') || $type2tag{$type_base} || die "can't find which tag to use for type $type";
        $config=XMLin($import_xml_file, ForceArray => [ $tag, 'config', 'format' ], ForceContent => 1 );
 
+       # check for broken XML::Simple
+       if ( XMLin('<foo><![CDATA[<bar>]]></foo>') eq '<bar>>' ) {
+               warn "XML::Simple on this system seems broken with <![CDATA[..]]>.\n";
+               map {
+                       $config->{format}->{$_}->{content} =~ s#>$##;
+               } keys %{ $config->{format} };
+       }
+
        # helper for progress bar
        sub fmt_time {
                my $t = shift || 0;