From: Clif H. <ch...@us...> - 2001-12-25 01:05:37
|
Update of /cvsroot/perl-ldap/ldap/lib/Net/LDAP In directory usw-pr-cvs1:/tmp/cvs-serv20284/ldap/lib/Net/LDAP Modified Files: DSML.pm Log Message: Made changes to _schemaToXML subroutine to speed it up. Index: DSML.pm =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/DSML.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- DSML.pm 2001/12/20 05:05:33 1.7 +++ DSML.pm 2001/12/25 01:05:32 1.8 @@ -1,5 +1,9 @@ package Net::LDAP::DSML; +# +# $Id$ +# + # For schema parsing, add ability to Net::LDAP::Schema to accecpt # a Net::LDAP::Entry object. First # we'll convert XML into Net::LDAP::Entry with schema attributes and @@ -243,9 +247,6 @@ # Now comes the real work, parse and configure the # data into DSML XML format. # - my @keys = keys(%container); - foreach my $name ( @keys ) - { # # Take care of the attribute-type and objectclass-type # section first. @@ -332,7 +333,7 @@ # Opening element and attributes are done, # finish the other elements. # - elsif ( $name eq "syntax" ) + if ( $container{'syntax'} ) { $dstring = "<dsml:syntax"; if ( $container{'max_length'} ) @@ -353,7 +354,8 @@ push(@$fh, $dstring); delete($container{'syntax'} ); } - elsif ( $name eq "desc" ) + + if ( $container{'desc'} ) { $dstring = "<dsml:description>"; $raData = $container{'desc'}; @@ -362,7 +364,8 @@ push(@$fh, $dstring); delete($container{'desc'} ); } - elsif ( $name eq "ordering" ) + + if ( $container{'ordering'} ) { $dstring = "<dsml:ordering>"; $raData = $container{'ordering'}; @@ -374,7 +377,8 @@ } delete($container{'ordering'} ); } - elsif ( $name eq "equality" ) + + if ( $container{'equality'} ) { $dstring = "<dsml:equality>"; $raData = $container{'equality'}; @@ -386,7 +390,8 @@ } delete($container{'equality'} ); } - elsif ( $name eq "substr" ) + + if ( $container{'substr'} ) { $dstring = "<dsml:substring>"; $raData = $container{'substr'}; @@ -398,7 +403,8 @@ } delete($container{'substr'} ); } - elsif ( $container{'may'} ) + + if ( $container{'may'} ) { my $data = $container{'may'}; foreach my $t1 (@$data ) @@ -407,7 +413,8 @@ } delete($container{'may'} ); } - elsif ( $container{'must'} ) + + if ( $container{'must'} ) { my $data = $container{'must'}; foreach my $t1 (@$data ) @@ -416,8 +423,6 @@ } delete($container{'must'} ); } - - } $dstring ="</dsml:$title>\n"; push(@$fh, $dstring); |