Ad Widget

Collapse

PATCH: make HTML valid XML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ays
    Junior Member
    • Jan 2006
    • 11

    #1

    PATCH: make HTML valid XML

    Hello,

    This patch will change slightly page_header.php. As the result, HTML produced by php frontend will be valid XML, and therefore will be parseble by XML parsers, XSLT transformers etc.

    For example, it is required by Zabbix gadget for Google Desktop, described here.
    Attached Files
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    This patch makes ZABBIX HTML invalid!
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • ays
      Junior Member
      • Jan 2006
      • 11

      #3
      why?

      Why?

      Seriously

      It is allowed to have some tags in HTML to leave 'opened' but if they will be closed, nothing will be wrong.

      In HTML it is allowed to do following:
      Code:
      <meta blah='...' blahBlah='sdfsdf'>
      Paragraph 1<br>Paragraph 2
      <p>paragraph 3
      But it is forbidden in XML.

      But it is OK for both HTML and XML to do:
      Code:
      <meta blah='...' blahBlah='sdfsdf'/>
      Paragraph 1<br/>Paragraph 2
      <p>paragraph 3</p>

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        Originally posted by ays
        Why?
        Because the HTML code didn't pass www.w3c.org validation.
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • ays
          Junior Member
          • Jan 2006
          • 11

          #5
          Wow! I didn't knew that it is not good to close tags in the head part

          Anyway, browsers which thinks that any closed tag in the head part closes the whole head part and programmers, who do not put <body> in html, as it is not mandatory, are a bit not so bright

          Aleksey, thanks for something new

          Gadget itself rewritten to strip meta and link tags.

          Comment

          Working...