superfluous shape="area' when using html:parse()
Sunday, 30 August 2020 · 2 messages
JO
Jos van den Oever30 Aug 2020 14:01 #
Hi all,
When loading a document with
html:parse(), an extra attribute is added to every <a/> element. <a href="abc"></a> becomes <a shape="rect" href="abc"></a>This error is even shown in the example on the wiki:
https://docs.basex.org/wiki/HTML_Module
It turns out this behaviour can be avoided by using the 'nodefaults" option of TagSoup:
html:doc($uri, map { 'nodefaults': true() })That's a lot faster than removing these attributes from loaded document.
⤳Jos
LQ
Liam R. E. Quin30 Aug 2020 21:25 #
Quoted text · Jos van den Oever · 8 lines
On Sun, 2020-08-30 at 14:01 +0200, Jos van den Oever wrote: > Hi all, > > When loading a document with html:parse(), an extra attribute is > added to > every <a/> element. > > <a href="abc"></a> becomes <a shape="rect" href="abc"></a>
This usually comes from the HTML 4 or XHTML 1.x DTDs. It is actually not incorrect behaviour, although i never liked it either.
It's similar to inferring a tbody element in a table if none was supplied.
Liam
--
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. Barefoot Web-slave, antique illustrations: http://www.fromoldbooks.org
Written for BaseX 9.4. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery