generate.id.attributes

generate.id.attributes — Generate ID attributes on container elements?

Synopsis

<xsl:param name="generate.id.attributes" select="0"></xsl:param>

Description

If non-zero, the HTML stylesheet will generate ID attributes on containers. For example, the markup:

<section id="foo"><title>Some Title</title>
<para>Some para.</para>
</section>

might produce:

<div class="section" id="foo">
<h2>Some Title</h2>
<p>Some para.</p>
</div>

The alternative is to generate anchors:

<div class="section">
<h2><a name="foo"></a>Some Title</h2>
<p>Some para.</p>
</div>

Because the name attribute of the a element and the id attribute of other tags are both of type ID, producing both generates invalid documents.

As of version 1.50, you can use this switch to control which type of identifier is generated. For backwards-compatibility, generating a anchors is preferred.

Note: at present, this switch is incompletely implemented. Disabling ID attributes will suppress them, but enabling ID attributes will not suppress the anchors.