generate.id.attributes.xml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <refentry xmlns="http://docbook.org/ns/docbook"
  2. xmlns:xlink="http://www.w3.org/1999/xlink"
  3. xmlns:xi="http://www.w3.org/2001/XInclude"
  4. xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
  5. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  6. version="5.0" xml:id="generate.id.attributes">
  7. <refmeta>
  8. <refentrytitle>generate.id.attributes</refentrytitle>
  9. <refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo>
  10. </refmeta>
  11. <refnamediv>
  12. <refname>generate.id.attributes</refname>
  13. <refpurpose>Generate ID attributes on container elements?</refpurpose>
  14. </refnamediv>
  15. <refsynopsisdiv>
  16. <src:fragment xml:id="generate.id.attributes.frag">
  17. <xsl:param name="generate.id.attributes" select="0"/>
  18. </src:fragment>
  19. </refsynopsisdiv>
  20. <refsection><info><title>Description</title></info>
  21. <para>If non-zero, the HTML stylesheet will generate ID attributes on
  22. containers. For example, the markup:</para>
  23. <screen>&lt;section id="foo"&gt;&lt;title&gt;Some Title&lt;/title&gt;
  24. &lt;para&gt;Some para.&lt;/para&gt;
  25. &lt;/section&gt;</screen>
  26. <para>might produce:</para>
  27. <screen>&lt;div class="section" id="foo"&gt;
  28. &lt;h2&gt;Some Title&lt;/h2&gt;
  29. &lt;p&gt;Some para.&lt;/p&gt;
  30. &lt;/div&gt;</screen>
  31. <para>The alternative is to generate anchors:</para>
  32. <screen>&lt;div class="section"&gt;
  33. &lt;h2&gt;&lt;a name="foo"&gt;&lt;/a&gt;Some Title&lt;/h2&gt;
  34. &lt;p&gt;Some para.&lt;/p&gt;
  35. &lt;/div&gt;</screen>
  36. <para>Because the <tag class="attribute">name</tag> attribute of
  37. the <tag>a</tag> element and the <tag class="attribute">id</tag>
  38. attribute of other tags are both of type <quote>ID</quote>, producing both
  39. generates invalid documents.</para>
  40. <para>As of version 1.50, you can use this switch to control which type of
  41. identifier is generated. For backwards-compatibility, generating
  42. <tag>a</tag> anchors is preferred.</para>
  43. <para>Note: at present, this switch is incompletely implemented.
  44. Disabling ID attributes will suppress them, but enabling ID attributes
  45. will not suppress the anchors.</para>
  46. </refsection>
  47. </refentry>