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

Hi Monks, I'm getting the error message:
junk after document element at line 14, column 0, byte 433 at /usr/lib +/perl5/site_perl/5.6.1/i386-linux/XML/Parser.pm line 185
where, XML::Twig uses the XML::Parser. I know that the code that I am using works with another XML document. Has anyone else seen anything similar to this. I can post more code for anyone that is interested. I'm not quite sure how to start debugging this.

Replies are listed 'Best First'.
Re: XML::Parser and XML::Twig
by mirod (Canon) on Dec 09, 2002 at 15:22 UTC

    The message means just that: the parser finds something after the end of the document. This is illegal in XML. Use the ErrorContext => 1 option when you create the twig in order to get the line displayed.

    This message often happens when your XML dosument does not have a root.

      Tests suggest that the problem was that I had missing attribute data. Do XML modules not normally allow for missing attribute data (vague question I know, sorry)?