validating HTML5 documents in oXygen 14.2

laurendw
Posts: 5

validating HTML5 documents in oXygen 14.2

Thu Aug 22, 2013 2:55 am

Hi all,

in the current HTML5 specification, there is an example of a very simple HTML5 document at http://www.w3.org/TR/html5/single-page. ... ml-element.

Code: Select all

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Swapping Songs</title>
    </head>
    <body>
        <h1>Swapping Songs</h1>
        <p>Tonight I swapped some of the songs I wrote with some friends, who
            gave me some of the songs they wrote. I love sharing my music.</p>
    </body>
</html>


From reading this thread: topic7698.html, I thought a basic HTML5 document would be marked as valid. The error message I get is

Code: Select all

System ID: C:\temp\test.html
Main validation file: C:\temp\test.html
Schema: C:\Program Files\Oxygen XML Editor 14\frameworks\xhtml\xhtml5 (epub3)\epub-xhtml-30.nvdl
Engine name: Jing
Severity: error
Description: elements from namespace "" are not allowed
Start location: 2:17


If I add some empty elements such as link, those are also flagged since they don't have end tags. But for this purpose, I want to use the HTML5 syntax if at all possible, not the XHTML syntax. How do I get this to work?

thanks,

Lauren
Radu
Posts: 5093

Re: validating HTML5 documents in oXygen 14.2

Thu Aug 22, 2013 9:52 am

Hi Lauren,

Oxygen can only be used to edit wellformed XHTML content which also declares the XHTML namespace.
So your example would also need to declare the XHTML namespace on the <html> element like:

Code: Select all

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Swapping Songs</title>
  </head>
  <body>
    <h1>Swapping Songs</h1>
    <p>Tonight I swapped some of the songs I wrote with some friends, who gave me some of the songs
      they wrote. I love sharing my music.</p>
  </body>
</html>


Empty elements like <link> can be added to the XHTML content like this:

Code: Select all

    <link href="test.css" rel="" />


Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
laurendw
Posts: 5

Re: validating HTML5 documents in oXygen 14.2

Thu Aug 22, 2013 7:33 pm

Thanks Radu. It sounds like documents written according to the polyglot spec http://www.w3.org/TR/html-polyglot/ should validate, but the full validation according to that specification is not checked (since, for example, xml:base is not allowed in polyglot documents). I can work with that.

Return to “XHTML”

Who is online

Users browsing this forum: No registered users and 0 guests