From 460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kresources/groupwise/soap/extractxml.pl | 57 +++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100755 kresources/groupwise/soap/extractxml.pl (limited to 'kresources/groupwise/soap/extractxml.pl') diff --git a/kresources/groupwise/soap/extractxml.pl b/kresources/groupwise/soap/extractxml.pl new file mode 100755 index 000000000..ecab50861 --- /dev/null +++ b/kresources/groupwise/soap/extractxml.pl @@ -0,0 +1,57 @@ +#!/usr/bin/perl + +if ( @ARGV != 1 ) { + print STDERR "Usage: extractxml.pl \n"; + exit 1; +} + +$in = $ARGV[ 0 ]; + +print "In: $in\n"; + +if ( !open IN, $in ) { + print STDERR "Unable to open file '$in'.\n"; + exit 1; +} + +$count = 1; + +while ( ) { + if ( $xml ) { + if ( $_ =~ /(.*\<\/SOAP-ENV:Envelope\>)/ ) { + printXml( $xml . $1 ); + $xml = ""; + } else { + $xml .= $_; + } + } elsif ( $_ =~ /^(\<\?xml.*\?>)(.*)$/ ) { + $xml = $1 . $2; + + if ( $xml =~ /(.*\<\/SOAP-ENV:Envelope\>)/ ) { + printXml( $1 ); + $xml = ""; + + } + } +} + +sub printXml() +{ + $xml = shift; + + $xml =~ s/\n//g; + $xml =~ s/\r//g; + + $out = "$in.$count.xml"; + + print "Out: $out\n"; + + if ( !open OUT, ">$out" ) { + print STDERR "Unable to open file '$out'.\n"; + } else { + print OUT $xml; + close OUT; + } + + $count += 1; +} -- cgit v1.2.1