HTML5 attributes marked as "not allowed"

Oxygen general issues.
bassoon
Posts: 2
Joined: Wed Feb 06, 2019 10:36 am

HTML5 attributes marked as "not allowed"

Post by bassoon »

Hi, I'm trying to figure it out what I'm doing wrong. When I put an attribute 'download' to an <a> element in my html files Oxygen says 'attribute "download" not allowed here'. My code looks like this:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<a href="whatever" download="whatever"></a>
</body>
</html>

The HTML5 Recommendation says it's a valid attribute ('download - Whether to download the resource instead of navigating to it, and its file name if so'):
https://www.w3.org/TR/html52/textlevel- ... -a-element

So any help how to prevent this error messages in Oxygen XML (v. 20.1) will be appreciated. Thank you in advance!
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: HTML5 attributes marked as "not allowed"

Post by Radu »

Hi,

Possibly the schema Oxygen uses to validate HTML5 documents needs to be updated in order not to report this as a problem anymore. I'll add an issue for this and we'll look into the specification.
In the meantime if you open this Relax NG schema file:

OXYGEN_INSTALL_DIR\frameworks\xhtml\xhtml5 (epub3)\mod\html5\html5-phrasing-30.rnc

at some point it has a line like this:

Code: Select all

   html5.a.attrs &= ( html5.href.attr & ( html5.hreflang.attr? & html5.target.attr? 
& html5.rel.attr? & html5.media.attr? & html5.type.mime.attr? ))?
which can be replaced with:

Code: Select all

   html5.download.attr = attribute download { datatype.html5.URL.spaces }
html5.a.attrs &= ( html5.href.attr & ( html5.hreflang.attr? & html5.target.attr?
& html5.rel.attr? & html5.media.attr? & html5.type.mime.attr? & html5.download.attr))?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: HTML5 attributes marked as "not allowed"

Post by Radu »

Hi,

As an update Oxygen 21.1 was released and it should have a fix for this problem.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply