in reply to Keep quotes around numerical attributes after parsing with HTML::Treebuilder?

Sounds like the module is doing the right thing. Numeric attribute values don't need to be quoted in HTML. Perhaps you want the as_XML method instead.

--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

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

Replies are listed 'Best First'.
Re^2: Keep quotes around numerical attributes after parsing with HTML::Treebuilder?
by tphyahoo (Vicar) on Jul 19, 2005 at 10:15 UTC
    Many thanks, I had overlooked that method. I'm unclear though -- is html in xml format the same as xhtml, or is the mapping messier? In other words, does as_xml also mean xhtml as well? If yes, I could use this rather than the tidy solution I explained above on the update.
      XHTML is HTML 4.01 conforming to the XML standards.

      CountZero

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

        Well "...ish".

        You can't write HTML 4.01 that conforms to XML standards, but XHTML 1.0 is a language that reimplements HTML 4.01 in XML.

        The obvious change to give as an example is that <br> in HTML is <br/> in XHTML - but if you tried to use <br/> in HTML then it would mean the same as <br/>> (or a line beak followed by a greater than symbol).

        So you can't just output XHTML and then slap an HTML Doctype on it. (Heck, its not really safe to serve XHTML as text/html despite what it says in Appendix C of the XHTML 1.0 Spec.)