Subject: Re: [docbook-apps] "anchor" template outputs invalid XHTML: empty "a" tag
Jirka Kosek's message dated: Thu, 08 Apr 2010 10:27:10 +0200 > Ad point of generating empty <a/> elements -- empty <a> is valid XHTML > Strict. The problem is that such markup doesn't work properly in some > browsers that parse XHTML content as it was HTML content (ie. not using > XML parser). I think one problem with <a/> is that the XHTML 1.0 standard says (4.3), "All elements other than those declared in the DTD as EMPTY must have an end tag. Elements that are declared in the DTD as EMPTY can have an end tag or can use empty element shorthand." While the purpose of this is evidently to avoid things like '<p>...<p>...', in a strict (perhaps perverse?) sense it requires <a></a> instead of <a/>. I have verified, for whatever it's worth, that Firefox will correctly render something in XHTML that includes an empty anchor expressed as <a id="someId"></a> but will display something erroneous if it is <a id="someID"/> , a somewhat surprising result.