Try XML::Parser. The "no element . . ." error may indicate malformed xml, but it may just be that it doesn't act like RSS. The position suggests that you may lack a root element.
| [reply] |
Thanks for the quick replies
Nope, never tried validating the xml.
The thing is, I think I'm trying to use XML::RSS and parsing the file as if it was a RSS xml feed file.
The beginning part of the first line is
<?xml version="1.0"?>
Basically I want to read and parse certain items from the xml file, so I guess I will try using XML::Parser.
From my post above, the error says its coming from line 187 from the XML::Parser module file.
Its maybe because I'm using it with XML::RSS and that my xml file is not a rss rile, but instead a xml 1.0 file.
Thanks
| [reply] [d/l] |
The 'no element found ...' message actually comes from XML::Parser, which is used by XML::RSS. Often you get that message if you parse a filename (you wanted to parse the file but you parsed the string because you used the parse method instead of the parsefile method).
If this is not the problem, you should parse the XML with xmllint (which comes with libxml2) or xmlwf (which comes with expat), or just with perl -MXML::Parser -e'XML::Parser->new( ErrorContext => 1)->parsefile( "yourfile.xml")'
| [reply] [d/l] |
Have you valiated the failing XML with any other tools? | [reply] |