in reply to Re^5: Keep quotes around numerical attributes after parsing with HTML::Treebuilder?
in thread Keep quotes around numerical attributes after parsing with HTML::Treebuilder?

if you tried to use <br/> in HTML then it would mean the same as <br/>> (or a line break followed by a greater than symbol)
Are you sure? I tried <br/> in a small HTML-file and had it validated by the "official" W3C-validator at http://validator.w3.org.

Oh its valid - it just means something different - a line break followed by a greater than sign (rather than just a line break). Anywhere you can have a line break you can have character data, and a greater than character is character data.

I did make a typo in my previous comment though.

In HTML <br/> means the same as <br>>, not <br/>> (because <br/ means the same as <br> - SGML is complicated)

  • Comment on Re^6: Keep quotes around numerical attributes after parsing with HTML::Treebuilder?

Replies are listed 'Best First'.
Re^7: Keep quotes around numerical attributes after parsing with HTML::Treebuilder?
by CountZero (Bishop) on Jul 19, 2005 at 19:59 UTC
    <br/> doesn't show a line break followed by a greater than symbol in version 1.05 of FireFox. To do that I have to effectively double-up the > symbol.

    <br/ slurps everything until the next > into the line break, so it is definitely not the same as <br/>!

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      Most browsers have tag soup parsers that don't follow SGML rules correctly, Firefox is one of them.

      See how the validator handles it (by comparing the source code with the parse tree).

        You're right: <br/ gets parsed into <br></br>.

        However, even under HTML 4.01 strict <br/> gets parsed into <br></br> as well!

        CountZero

        "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law