in reply to Script Misses Close Closing Tags

I can't tell where to start here.

Nor could I, as the passthrough_...-subs aren't anywhere in your code.

Could a CPAN Module like XML::Simple help you ease the pain of parsing it with that legacy code?

Edit:
Meditating over the code I noticed that the start/end routines seem to deal with <scripRef> differently. Might that be a hint to the source of the error omitting the closing tag?

Sören

Replies are listed 'Best First'.
Re: Re: Script Misses Close Closing Tags
by monger (Friar) on Mar 15, 2004 at 19:13 UTC
    Here's the passthrough code snip:
    sub passthrough_start { return if ($ignore); my ($tag) = @_; $sectionData{$currentDepth} .= "<$tag>"; } sub passthrough_end { return if ($ignore); my ($tag) = @_; $sectionData{$currentDepth} .= "</$tag>"; }

    One of my problems is not understanding the SWITCH in the module. Also, I've never written any modules, or looked deeply at existing ones that have something like that.

    Also, the tags should be dealt with differently. In the original XML file, the opening scripRef tag can have much more information in it. The closing one is generally just </scripRef>.

    Thanks, Monger

    Monger +++++++++++++++++++++++++ Munging Perl on the side
      There's not enough information here to tell for sure what's wrong, but I notice that the closing tag for scripRef checks $ignore (in passthrogh_end), while the opening tag doesn't. The SWITCH idiom is explained in perlsyn.