I am afraid that you have not understood what "junk after document element" means. It does not mean at all that there are weird characters in the document. An XML document should have one, and only one root element, so anything after the end of the first element should not be there and is reported as junk. It looks like your document is missing a wrapping tag, the "one to tie them all":

This is not an XML document:

<cd id="cd1">...</cd> <cd id="cd2">...</cd> <cd id="cd3">...</cd>

You need this:

<cd_list> <cd id="cd1">...</cd> <cd id="cd2">...</cd> <cd id="cd3">...</cd> </cd_list>

And you don't need to do byte-level file inspection at all.

By the way, you asked basically the same question on c.l.p.m a little while ago and got 2 answers which explained the exact same thing, so I expect you already fixed your problem, and you don't need to link your way to examin a file to the "junk" message, which might mislead other people having the same problem.


In reply to Re: Byte-level file inspection? by mirod
in thread Byte-level file inspection? by princepawn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.