- fix xml parsing, allow to put strings in single quote
authorMichael Schroeder <mls@suse.de>
Tue, 26 Oct 2010 14:33:05 +0000 (16:33 +0200)
committerMichael Schroeder <mls@suse.de>
Tue, 26 Oct 2010 14:33:48 +0000 (16:33 +0200)
Build/Kiwi.pm

index 37b6f52..17980b5 100644 (file)
@@ -38,18 +38,19 @@ sub parsexml {
       $tag = substr($tag, 1);
       chop $tag;
     }
-    my @tag = split(/(=(?:\"[^\"]*\"|[^\"\s]*))?\s+/, "$tag ");
+    my @tag = split(/(=(?:\"[^\"]*\"|\'[^\']*\'|[^\"\s]*))?\s+/, "$tag ");
     $tag = shift @tag;
     shift @tag;
     push @tag, undef if @tag & 1;
     my %atts = @tag;
     for (values %atts) {
       next unless defined $_;
-      s/^=\"([^\"]*)\"$/=$1/s;
+      s/^=\"([^\"]*)\"$/=$1/s or s/^=\'([^\']*)\'$/=$1/s;
       s/^=//s;
       s/&lt;/</g;
       s/&gt;/>/g;
       s/&amp;/&/g;
+      s/&apos;/\'/g;
       s/&quot;/\"/g;
     }
     if ($mode == 0 || $mode == 2) {