OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] "anchor" template outputs invalid XHTML: empty "a" tag


Hi,
I'm not quite understanding the problem here.  It appears that the customization 
applied by publican changed the template named 'anchor' in xhtml/html.xsl from 
generating an <a/> element to just outputting an attribute, with the assumption that 
the id attribute would be applied to the element that called the anchor template.  As 
you discovered that change does not always work because of intervening content.

But I'm not understanding this statement from the Bugzilla report:

"It is never valid to have an anchor tag
with no content in XHTML, so we don't do that."

I don't believe that statement is true.  If you examine the XHTML standard DTDs, you 
find that the content model of element <a> allows it to be empty.   What is the basis 
for this statement?

Perhaps the writer did not mean "invalid" in the DTD sense.  Are there issues with 
some browsers in the way they handle empty <a/> tags? Examples of where empty a tags 
create problems would be useful.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net


----- Original Message ----- 
From: "Raphael Hertzog" <raphael@ouaza.com>
To: <docbook-apps@lists.oasis-open.org>
Sent: Tuesday, April 06, 2010 12:44 AM
Subject: [docbook-apps] "anchor" template outputs invalid XHTML: empty "a" tag


Hello,

I recently reported a bug in publican because it uses the XSL XHTML stylesheets
and overrides the "anchor" template in a way that doesn't always work:
https://bugzilla.redhat.com/show_bug.cgi?id=579069

It turns out the override is there because the current output of the XSL
XHTML stylesheet for the anchor template is invalid XHTML: the "a" tag
cannot be empty apparently.

So they changed the initial template:
<a id="{$id}" />
Into:
<xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>

But the latter fails at least in 2 cases in the current usage of the
"anchor" template in the HTML stylesheet when it's called somewhere that
is not at the start of a new tag:
- in html/callout.xsl for match="co" mode="co"
- in html/verbatim.xsl for match="programlisting|screen|synopsis"

You'll get errors like:
xsl:attribute: Cannot add attributes to an element if children have been already added 
to the element.

It would be nice to see this fixed in a way or another so that publican
doesn't have to override the template just to have valid XHTML output.

Cheers,
-- 
Raphaël Hertzog -+- http://www.ouaza.com

Freexian : des développeurs Debian au service des entreprises
http://www.freexian.com

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]