in reply to Re: HTML::TreeBuilder bug or feature?
in thread HTML::TreeBuilder bug or feature?

I trimmed the !DOCTYPE tag contents down because I didn't need more than that to demonstrate the problem, which is that the declaration tag and the comment tag move to after the body when the HTML is generated. Actually, that is the way it is stored in $tree. Swapping the two problematic tag entries in $tree->{_content} to the start of the array "fixes" the problem.

The sample "HTML" is not intended to be valid beyond the extent needed to demonstrate the problem.


Perl is Huffman encoded by design.
  • Comment on Re^2: HTML::TreeBuilder bug or feature?

Replies are listed 'Best First'.
Re^3: HTML::TreeBuilder bug or feature?
by pg (Canon) on Sep 07, 2005 at 05:12 UTC

    I guess that it was my fault. Please see my update above. I understand perfectly that we all cherish our program and don't want others to modify it, as if there was something wrong with it.

    I really don't want you to take it in the wrong way, and I am sorry if I made you felt bad, although it was not my intention. My intention was definitely not what you thought it was, and I was not commenting your code. I was merely try to prove that it was a bug, but from a HTML specification point of view.

    Put in this way, had the coverted HTML with DOCTYPE at its end also passed the validation, as did the original one, I would have probably said that it was not a bug.

      Please accept my appology for misunderstanding your reply. I thought you had misunderstood the nature of the bug I was highlighting and that you had latched on to something spurious. You had not and I now understand what you were doing.

      Cheers, GrandFather


      Perl is Huffman encoded by design.