0 Replies Latest reply on Feb 2, 2009 11:26 AM by Newsgroup_User

    xmlValidate() with xhtml dtd.

    Level 7
      How would one use xmlValidate() against the xhtml dtd?

      I'm trying this simple test.

      <cffile file="/path/to/file/xhtml.cfm" action="read" variable="test">
      <cfset
      foobar=xmlValidate(test,' http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd')>
      <cfdump var="#foobar#">

      xhtml.cfm
      ----------
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns=" http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html;
      charset=utf-8" />
      <title>Untitled Document</title>
      </head>
      <body>
      <h1>Hello World</h1>
      </body>
      </html>

      I seem to be unable to create any valid XHTML file according to the
      xmlValidate() function. I get these errors, depending on what is or is
      not in the 'xhtml.cfm' file.

      [Fatal Error] :29:11: Recursive entity reference "%HTMLlat1". (Reference
      path: %HTMLlat1 -> %HTMLlat1 -> %HTMLlat1),
      With Doctype and xmlns.

      [Error] :1:44: cvc-elt.1: Cannot find the declaration of element 'html'.
      Without DOctype but with xmlns.

      [Error] :1:7: cvc-elt.1: Cannot find the declaration of element 'html'.
      Without Doctype or xmlns.