429 |
|
$xmltemp .= &make_xml("$curlevel$curtag", $curline); |
430 |
|
} |
431 |
|
my($nextline) = $data[0]; chomp $nextline if defined $nextline; |
432 |
< |
if((defined $nextline) && ($nextline =~ /^$curlevel$curtag/)) { |
432 |
> |
$curtag =~ s/(.*)\./$1/; |
433 |
> |
if((defined $nextline) && ($nextline =~ /^$curlevel$curtag\./)) { |
434 |
|
$curline = ""; |
435 |
|
} |
436 |
|
else { |
436 |
– |
$curtag =~ s/(.*)\./$1/; |
437 |
|
$xmltemp = "<$curtag$attributes>$xmltemp</$curtag>" unless $curtag eq ""; |
438 |
|
return $xmltemp; |
439 |
|
} |
451 |
|
return $xmltemp; |
452 |
|
} |
453 |
|
} |
454 |
+ |
# dealing with a null value |
455 |
+ |
elsif($curline =~ /^$curlevel([^\.\s]+)$/) { |
456 |
+ |
# simply adding a space makes the above elsif deal with it :) |
457 |
+ |
# just level with an empty tag in the XML |
458 |
+ |
$curline .= " "; |
459 |
+ |
} |
460 |
+ |
# failing all that, skip the line |
461 |
+ |
else { |
462 |
+ |
$curline = ""; |
463 |
+ |
} |
464 |
|
} |
465 |
|
} |