lamp has asked for the wisdom of the Perl Monks concerning the following question:

while parsing a xml file using XML::Simple (version 2.14) module, the script is failing by throwing the following error.

End tag mismatch ( != Value) Ln: 135, Col: 102

Can anybody give some idea to solve this issue??


Replies are listed 'Best First'.
Re: XMLin error while parsing
by moritz (Cardinal) on Aug 26, 2008 at 08:33 UTC
    It probably means that your data file isn't valid XML, and that a tag is closed by a different tag, something like
      I've found that problem is related with SAX library, I have solved just telling XML::Simple to use another XML library to parse the XML, using the following line:


      You will need the XML::Parser library, but it's usually installed when install XML::Simple.
Re: XMLin error while parsing
by Skeeve (Parson) on Aug 26, 2008 at 08:42 UTC

    I suggest opening the file in some XML-aware editor like jEdit for further investigation.

      ... or use Firefox esp. if you've got one of the excellent web development extensions installed e.g. Web Developer or XML Developer Toolbar ...

      A user level that continues to overstate my experience :-))
        I would think just "View Source" would be easier then trying to find some tool.
Re: XMLin error while parsing
by vaticide (Scribe) on Dec 13, 2009 at 17:50 UTC
    I'm getting this same error this morning. I haven't looked into it too far yet, but I can give this experience: the particular xml file I'm working with has some lines (outside of the entities it is complaining about, and not in CDATA hunks) containing only whitespace. If I remove the whitespace on those lines, it parses just fine. It looks like it may be something in my CDATA blocks that is confusing it... UPDATE: Upgrading my XML related modules seems to have solved this problem.