prefer.internal.olink.xml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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="prefer.internal.olink">
  7. <refmeta>
  8. <refentrytitle>prefer.internal.olink</refentrytitle>
  9. <refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo>
  10. </refmeta>
  11. <refnamediv>
  12. <refname>prefer.internal.olink</refname>
  13. <refpurpose>Prefer a local olink reference to an external reference</refpurpose>
  14. </refnamediv>
  15. <refsynopsisdiv>
  16. <src:fragment xml:id="prefer.internal.olink.frag">
  17. <xsl:param name="prefer.internal.olink" select="0"/>
  18. </src:fragment>
  19. </refsynopsisdiv>
  20. <refsection><info><title>Description</title></info>
  21. <para>If you are re-using XML content modules in multiple documents,
  22. you may want to redirect some of your olinks. This parameter
  23. permits you to redirect an olink to the current document.
  24. </para>
  25. <para>For example: you are writing documentation for a product,
  26. which includes 3 manuals: a little installation
  27. booklet (booklet.xml), a user
  28. guide (user.xml), and a reference manual (reference.xml).
  29. All 3 documents begin with the same introduction section (intro.xml) that
  30. contains a reference to the customization section (custom.xml) which is
  31. included in both user.xml and reference.xml documents.
  32. </para>
  33. <para>How do you write the link to custom.xml in intro.xml
  34. so that it is interpreted correctly in all 3 documents?</para>
  35. <itemizedlist>
  36. <listitem><para>If you use xref, it will fail in user.xml.</para>
  37. </listitem>
  38. <listitem><para>If you use olink (pointing to reference.xml),
  39. the reference in user.xml
  40. will point to the customization section of the reference manual, while it is
  41. actually available in user.xml.</para>
  42. </listitem>
  43. </itemizedlist>
  44. <para>If you set the <parameter>prefer.internal.olink</parameter>
  45. parameter to a non-zero value, then the processor will
  46. first look in the olink database
  47. for the olink's <tag>targetptr</tag> attribute value
  48. in document matching the <parameter>current.docid</parameter>
  49. parameter value. If it isn't found there, then
  50. it tries the document in the database
  51. with the <tag>targetdoc</tag>
  52. value that matches the olink's <tag>targetdoc</tag>
  53. attribute.
  54. </para>
  55. <para>This feature permits an olink reference to resolve to
  56. the current document if there is an element
  57. with an id matching the olink's <tag>targetptr</tag>
  58. value. The current document's olink data must be
  59. included in the target database for this to work.</para>
  60. <caution>
  61. <para>There is a potential for incorrect links if
  62. the same <tag>id</tag> attribute value is used for different
  63. content in different documents.
  64. Some of your olinks may be redirected to the current document
  65. when they shouldn't be. It is not possible to control
  66. individual olink instances.</para>
  67. </caution>
  68. </refsection>
  69. </refentry>