--- loncom/xml/lonxml.pm 2011/11/21 21:45:36 1.524 +++ loncom/xml/lonxml.pm 2011/12/01 04:14:12 1.525 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.524 2011/11/21 21:45:36 www Exp $ +# $Id: lonxml.pm,v 1.525 2011/12/01 04:14:12 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2049,11 +2049,13 @@ sub register_insert_xml { while (my $token = $parser->get_token()) { if ($token->[0] eq 'S') { my $key; - if ($token->[1] eq 'tag') { + if ($token->[1] eq 'tag') { $tag = $token->[2]{'name'}; - $insertlist{$tagnum.'.tag'} = $tag; - $insertlist{$tag.'.num'} = $tagnum; - push(@alltags,$tag); + if (defined($tag)) { + $insertlist{$tagnum.'.tag'} = $tag; + $insertlist{$tag.'.num'} = $tagnum; + push(@alltags,$tag); + } } elsif ($in_help && $token->[1] eq 'file') { $key = $tag.'.helpfile'; } elsif ($in_help && $token->[1] eq 'description') {