Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

XMLin error while parsing

by lamp (Chaplain)
on Aug 26, 2008 at 08:25 UTC ( #706838=perlquestion: print w/replies, xml ) Need Help??
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??

lamp

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
    <foo></bar>
      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:

      $XML::Simple::PREFERRED_PARSER='XML::Parser';

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

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


    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
      ... 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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://706838]
Approved by moritz
help
Chatterbox?
LanX "I put lipstick on a pig,"
[erix]: it does seem to get out of hand -- but then again, it looks like that for months already :)
[LanX]: the bets are rather who will leave office first Trump or May
[erix]: Harakiri with a nuke on the white house, that'd clean up the staff there a bit too ;)

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (13)
As of 2017-08-18 13:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (302 votes). Check out past polls.

    Notices?