validating HTML5 documents in oXygen 14.2

laurendw
Posts: 7
Joined: Sat Apr 06, 2013 1:10 am

validating HTML5 documents in oXygen 14.2

Post by laurendw »

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: http://www.oxygenxml.com/forum/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: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: validating HTML5 documents in oXygen 14.2

Post by Radu »

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: 7
Joined: Sat Apr 06, 2013 1:10 am

Re: validating HTML5 documents in oXygen 14.2

Post by laurendw »

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.
Post Reply