HTML5 attributes marked as "not allowed"

<oXygen/> general issues.
bassoon
Posts: 1
Joined: Wed Feb 06, 2019 10:36 am

HTML5 attributes marked as "not allowed"

Post by bassoon » Sat Feb 16, 2019 12:17 pm

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: 6335
Joined: Fri Jul 09, 2004 5:18 pm

Re: HTML5 attributes marked as "not allowed"

Post by Radu » Mon Feb 18, 2019 9:02 am

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: 6335
Joined: Fri Jul 09, 2004 5:18 pm

Re: HTML5 attributes marked as "not allowed"

Post by Radu » Thu May 23, 2019 2:01 pm

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