merge the formfield patch from ooo-build
[ooovba.git] / oox / source / token / parsexsd.pl
blob3b6745121e4ce2ecce5a0527f3def035de445fbc
1 $ARGV = shift @ARGV;
2 my %tokens;
4 my @files = glob("$ARGV/*.rnc");
6 open( TOKEN, ">tokens.txt" ) || die "can't write token file";
8 foreach( @files )
10 print( "parsing $_\n" );
11 open ( XSD, $_ ) || die "can't open token file: $!";
12 while( <XSD> )
14 chomp($_);
15 if( /element (\S*:)?(\S*)/ )
17 $tokens{$2} = 1;
18 print(".");
20 elsif( /attribute (\S*:)?(\S*)/ )
22 $tokens{$2} = 1;
23 print(".");
25 elsif( /list\s*\{/ )
27 while( <XSD> )
29 chomp($_);
30 last if( /^\s*\}/ );
31 if( /"(\S*?)\"/ )
33 $tokens{$1} = 1;
34 print(".");
39 close ( XSD );
41 print("\n" );
44 foreach( sort(keys(%tokens)) )
46 print TOKEN "$_\n";
48 close( TOKEN );