Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

XMLin error while parsing

by lamp (Chaplain)
on Aug 26, 2008 at 08:25 UTC ( [id://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 (Parson) 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
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://706838]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2025-06-16 01:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.