File: linking.html

package info (click to toggle)
docbook-website 2.5.0.0-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,512 kB
  • sloc: xml: 1,341; lisp: 412; java: 77; makefile: 39; javascript: 8; sh: 2
file content (472 lines) | stat: -rw-r--r-- 19,396 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
<!DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
  <head>
    <meta name="generator" content=
    "HTML Tidy for Linux/x86 (vers 1st March 2002), see www.w3.org">
    <meta http-equiv="Content-Type" content=
    "text/html; charset=ISO-8859-1">
    <meta name="generator" content="Website XSL Stylesheet V2.4.1">
    <link rel="home" href="index.html" title="Welcome to Website">
    <link rel="up" href="index.html" title="Welcome to Website">
    <link rel="previous" href="layout.html" title="Site Layout">
    <link rel="next" href="custom.html" title=
    "Customizing the Stylesheets">
    <link rel="first" href="layout.html" title="Site Layout">
    <link rel="last" href="" title="nwalsh.com">
    <link rel="icon" href=
    "http://nwalsh.com/images/nwalsh-icon16.png" type="image/png">
    <link rel="stylesheet" href="example.css" type="text/css">

    <title>Linking Pages</title>
  </head>

  <body class="tabular" bgcolor="white" text="black" link="#0000FF"
  vlink="#840084" alink="#0000FF">
    <div class="webpage">
      <a name="olink"></a>

      <table border="0" cellpadding="0" cellspacing="0" width=
      "100%" summary="Navigation">
        <tr>
          <td><img src="graphics/spacer.gif" alt=" " width="1"
          height="1"></td>

          <td valign="top" align="left" bgcolor="white" rowspan=
          "2">
            <h1>Linking Pages</h1>

            <p>In Website, the website pages are separate XML
            documents, so it is not possible to use <tt class=
            "sgmltag-element">xref</tt> or <tt class=
            "sgmltag-element">link</tt> to make links between them.
            Instead, you must use <tt class=
            "sgmltag-element">olink</tt><sup>[<a name="d0e25" href=
            "#ftn.d0e25">1</a>]</sup>.</p>

            <p><tt class="sgmltag-element">Olink</tt> differs from
            other linking elements because it requires two
            attributes: one to locate the document and one to
            locate an ID value within that document. Here is an
            example of an <tt class=
            "sgmltag-element">olink</tt>:</p>
<pre class="programlisting">
&lt;olink targetdoc="home" targetptr="whatsnew"/&gt;
</pre>

            <div class="itemizedlist">
              <ul type="disc">
                <li>
                  <p>The <tt class=
                  "sgmltag-attribute">targetdoc</tt> attribute
                  identifies the document that contains the target
                  of the link. In Website, the <tt class=
                  "sgmltag-element">id</tt> attribute value on the
                  <tt class="sgmltag-element">webpage</tt> element
                  used as the document identifier since it must be
                  unique. Its value should be used in the <tt
                  class="sgmltag-attribute">targetdoc</tt>
                  attribute of an <tt class=
                  "sgmltag-element">olink</tt>.</p>
                </li>

                <li>
                  <p>The <tt class=
                  "sgmltag-attribute">targetptr</tt> attribute must
                  match an <tt class="sgmltag-element">id</tt>
                  attribute value on an element within that
                  document. If you want to link to the top of the
                  page, then the <tt class=
                  "sgmltag-attribute">targetptr</tt> is the same as
                  the <tt class="sgmltag-attribute">targetdoc</tt>
                  value.</p>
                </li>

                <li>
                  <p>If an <tt class="sgmltag-element">olink</tt>
                  has no content, then the stylesheet generates
                  content in a manner similar to an <tt class=
                  "sgmltag-element">xref</tt>. The content comes
                  from a website database document that the
                  stylesheets can create. If an <tt class=
                  "sgmltag-element">olink</tt> element has content,
                  then that is used instead of the generated
                  content.</p>
                </li>

                <li>
                  <p>Once you enter olinks in your webpages, you
                  need to make sure the right parameters are set to
                  process them.</p>
                </li>
              </ul>
            </div>

            <div class="section" lang="en">
              <div class="titlepage">
                <div>
                  <div>
                    <h2 class="title" style="clear: both"><a name=
                    "d0e107"></a>Olinks with XSLT build method</h2>
                  </div>
                </div>
              </div>

              <p>Here is how you process a website with olinks
              using the method.</p>

              <div class="orderedlist">
                <ol type="1">
                  <li>
                    <p>Create your <tt class=
                    "filename">layout.xml</tt> file the same as
                    before.</p>
                  </li>

                  <li>
                    <p>Process your <tt class=
                    "filename">layout.xml</tt> file as before with
                    the <tt class="filename">autolayout.xsl</tt>
                    stylesheet to create the <tt class=
                    "filename">autolayout.xml</tt> file.</p>
                  </li>

                  <li>
                    <p>Process your <tt class=
                    "filename">autolayout.xml</tt> file as before
                    with either the <tt class=
                    "filename">chunk-tabular.xsl</tt> or <tt class=
                    "filename">chunk-website.xsl</tt> stylesheet.
                    But set the parameter <tt class=
                    "literal">collect.xref.targets</tt> to the
                    value &#8220;<span class="quote"><tt class=
                    "literal">yes</tt></span>&#8221;. That will
                    generate a database file named <tt class=
                    "filename">website.database.xml</tt> in the
                    current directory, and use that to resolve
                    olinks.</p>
                  </li>
                </ol>
              </div>
            </div>

            <div class="section" lang="en">
              <div class="titlepage">
                <div>
                  <div>
                    <h2 class="title" style="clear: both"><a name=
                    "d0e170"></a>Olinks with Make method</h2>
                  </div>
                </div>
              </div>

              <p>Here is how you process a website with olinks
              using the method.</p>

              <div class="orderedlist">
                <ol type="1">
                  <li>
                    <p>Create your <tt class=
                    "filename">layout.xml</tt> file the same as
                    before.</p>
                  </li>

                  <li>
                    <p>Do the <tt class=
                    "literal">autolayout.xml</tt> and <tt class=
                    "literal">depends</tt> processing steps as
                    before.</p>
                  </li>

                  <li>
                    <p>Generate the website database file by
                    processing your <tt class=
                    "filename">autolayout.xml</tt> file with the
                    <tt class="filename">website-targets.xsl</tt>
                    stylesheet, saving the output to a file named
                    <tt class=
                    "filename">website.database.xml</tt>.</p>
                  </li>

                  <li>
                    <p>Process your website as you would normally
                    (usually by typing <b class="command">make
                    website</b>).</p>
                  </li>
                </ol>
              </div>

              <p>Here is a sample <tt class=
              "filename">Makefile</tt> using xsltproc and XML
              catalogs:</p>
<pre class="programlisting">
PROC = XML_CATALOG_FILES=../catalog.xml  xsltproc

all:
        make website

include depends.tabular

autolayout.xml:  layout.xml
        $(PROC) \
        --output  $@ \
        autolayout.xsl  $&lt;

        make depends

depends:  autolayout.xml
        $(PROC) \
        --output depends.tabular \
        --stringparam  output-root  htdocs  \
        makefile-dep.xsl  $&lt;

website.database.xml:  autolayout.xml
        $(PROC) \
        --output $@ \
       website-targets.xsl  $&lt;

%.html: autolayout.xml 
        $(PROC) \
        --output $@  \
        --stringparam  output-root  htdocs
        tabular.xsl  \
        $(filter-out autolayout.xml,$^)

</pre>
            </div>

            <div class="section" lang="en">
              <div class="titlepage">
                <div>
                  <div>
                    <h2 class="title" style="clear: both"><a name=
                    "d0e238"></a>Olinks with system entities</h2>
                  </div>
                </div>
              </div>

              <p>The original system for olinks uses SYSTEM
              entities referenced by a <tt class=
              "sgmltag-attribute">targetdocent</tt> attribute
              instead of a <tt class=
              "sgmltag-attribute">targetdoc</tt> attribute. And it
              uses the <tt class="sgmltag-attribute">localinfo</tt>
              attribute instead of <tt class=
              "sgmltag-attribute">targetptr</tt> to locate a
              reference point within the document. Here is how you
              process the original kind of olinks with Website.</p>

              <div class="orderedlist">
                <ol type="1">
                  <li>
                    <p>Create an entity declaration that identifies
                    the target page. For example, to link to this
                    page, I would use the following
                    declaration:</p>
<pre class="programlisting">
&lt;!ENTITY linking SYSTEM "olink.xml" NDATA XML&gt;
</pre>

                    <p>The name that you use for the entity, <tt
                    class="literal">linking</tt> in this case, is
                    irrelevant. The important thing is that the
                    entity point to the right page. I've used a
                    system identifier here, but you could also use
                    public identifiers if you wanted more
                    flexibility.</p>

                    <p>Keep in mind that the systen identifier
                    specified here must be either an absolute URI
                    or a relative URI that will resolve to the
                    target page (in other words, you may need to
                    prefix it with a partial path name, if you keep
                    your XML webpages in different
                    directories).</p>
                  </li>

                  <li>
                    <p>Make sure the webpage that you are linking
                    <span class="emphasis"><em>from</em></span>
                    (you don't have to do anything special to the
                    page you're linking to) has a &#8220;<span
                    class="quote">DOCTYPE</span>&#8221; declaration
                    with an internal subset. If your <tt class=
                    "sgmltag-element">olink</tt> entity is the only
                    thing in it, it should look like something like
                    this:</p>
<pre class="programlisting">
&lt;!DOCTYPE webpage PUBLIC "-//SF DocBook//DTD Website V2.0//EN"
          SYSTEM "http://www.sourceforge.net/docbook/release/website/2.0/website.dtd [
&lt;!ENTITY linking SYSTEM "olink.xml" NDATA XML&gt;
]&gt;
</pre>

                    <p>If you want to link to several different
                    pages, you will need an entity declaration for
                    each of them.</p>
                  </li>

                  <li>
                    <p>Use the <tt class=
                    "sgmltag-attribute">targetdocent</tt> attribute
                    of <tt class="sgmltag-element">olink</tt> to
                    identify the entity of the page you want to
                    link to:</p>
<pre class="programlisting">
&lt;olink targetdocent="linking"&gt;link text&lt;/olink&gt;
</pre>

                    <p>That will link to the correct page in the
                    resulting website. If you want to link to a
                    specific anchor in that web page, use the <tt
                    class="sgmltag-attribute">localinfo</tt>
                    attribute to specify the XML ID.</p>
                  </li>
                </ol>
              </div>
            </div>

            <div class="footnotes">
              <hr width="100" align="left">

              <div class="footnote">
                <p><sup>[<a name="ftn.d0e25" href=
                "#d0e25">1</a>]</sup> It's also possible to use <tt
                class="sgmltag-element">ulink</tt> and make links
                directly to the generated HTML pages, but that's a
                bad idea; if you change the hierarchy or rename a
                page, the link will become stale. With <tt class=
                "sgmltag-element">olink</tt> this won't happen.</p>
              </div>
            </div>
            <br>
          </td>
        </tr>

        <tr>
          <td valign="top" align="left" bgcolor="#4080FF" width=
          "220">
            <p class="navtoc"><a href="index.html"><img align=
            "left" border="0" src="graphics/banner.png" alt=
            "Banner"></a><br clear="all">
            <br>
            <span class="toplevel"><img src="graphics/blank.gif"
            alt="&#160;&#160;&#160;"><a href="layout.html" title=
            "Site Navigation Layout Setup"><img src=
            "graphics/navicons/triangle/other/leaf.gif" alt=
            "&#160;" border="0"></a><span class="otherpage"><a
            href="layout.html" title=
            "Site Navigation Layout Setup">Site
            Layout</a></span><br>
            </span><span class="toplevel"><img src=
            "graphics/blank.gif" alt="&#160;&#160;&#160;"><a href=
            "linking.html" title="Linking across Pages"><img src=
            "graphics/navicons/triangle/current/leaf.gif" alt="+"
            border="0"></a><span class="curpage">Linking&#160;<img
            src="graphics/navicons/triangle/current/pointer.gif"
            alt="&lt;-"></span><br>
            </span><span class="toplevel"><img src=
            "graphics/blank.gif" alt="&#160;&#160;&#160;"><a href=
            "custom.html" title=
            "Stylesheet customization instructions"><img src=
            "graphics/navicons/triangle/other/leaf.gif" alt=
            "&#160;" border="0"></a><span class="otherpage"><a
            href="custom.html" title=
            "Stylesheet customization instructions">Customization</a></span><br>

            </span><span class="toplevel"><img src=
            "graphics/blank.gif" alt="&#160;&#160;&#160;"><a href=
            "buildmake.html" title="Building strategies"><img src=
            "graphics/navicons/triangle/other/closed.gif" alt=
            "&#160;" border="0"></a><span class="otherpage"><a
            href="buildmake.html" title=
            "Building strategies">Building</a></span><br>
            </span><span class="toplevel"><img src=
            "graphics/blank.gif" alt="&#160;&#160;&#160;"><a href=
            "formtest.html" title="Form Test Page"><img src=
            "graphics/navicons/triangle/other/leaf.gif" alt=
            "&#160;" border="0"></a><span class="otherpage"><a
            href="formtest.html" title="Form Test Page">Form
            Test</a></span><br>
            </span><span class="toplevel"><img src=
            "graphics/blank.gif" alt="&#160;&#160;&#160;"><a href=
            "test3.html" title="XBEL Bookmark test"><img src=
            "graphics/navicons/triangle/other/leaf.gif" alt=
            "&#160;" border="0"></a><span class="otherpage"><a
            href="test3.html" title="XBEL Bookmark test">XBEL
            Bookmarks</a></span><br>
            </span><span class="toplevel"><img src=
            "graphics/blank.gif" alt="&#160;&#160;&#160;"><a href=
            "rddl.html" title="RDDL"><img src=
            "graphics/navicons/triangle/other/leaf.gif" alt=
            "&#160;" border="0"></a><span class="otherpage"><a
            href="rddl.html" title="RDDL">RDDL</a></span><br>
            </span><span class="toplevel"><img src=
            "graphics/blank.gif" alt="&#160;&#160;&#160;"><a href=
            "php.html" title="PHP"><img src=
            "graphics/navicons/triangle/other/leaf.gif" alt=
            "&#160;" border="0"></a><span class="otherpage"><a
            href="php.html" title="PHP">PHP</a></span><br>
            </span><span class="toplevel"><img src=
            "graphics/blank.gif" alt="&#160;&#160;&#160;"><a href=
            "rss.html"><img src=
            "graphics/navicons/triangle/other/leaf.gif" alt=
            "&#160;" border="0"></a><span class="otherpage"><a
            href="rss.html">RSS</a>&#160;<img src=
            "graphics/navicons/triangle/added.gif" alt=
            "New"></span><br>
            </span><span class="toplevel"><img src=
            "graphics/blank.gif" alt="&#160;&#160;&#160;"><a href=
            "full.html" title="Full Website"><img src=
            "graphics/navicons/triangle/other/leaf.gif" alt=
            "&#160;" border="0"></a><span class="otherpage"><a
            href="full.html" title=
            "Full Website">Website-Full</a>&#160;<img src=
            "graphics/navicons/triangle/added.gif" alt=
            "New"></span><br>
            </span><span class="toplevel"><img src=
            "graphics/blank.gif" alt="&#160;&#160;&#160;"><a href=
            "revflag.html" title="Revision Flags"><img src=
            "graphics/navicons/triangle/other/leaf.gif" alt=
            "&#160;" border="0"></a><span class="otherpage"><a
            href="revflag.html" title="Revision Flags">Revision
            Flags</a></span><br>
            </span><span class="toplevel"><img src=
            "graphics/blank.gif" alt="&#160;&#160;&#160;"><a href=
            "http://nwalsh.com/"><img src=
            "graphics/navicons/triangle/other/leaf.gif" alt=
            "&#160;" border="0"></a><span class="otherpage"><a
            href="http://nwalsh.com/">nwalsh.com</a></span><br>
            </span><br>
            </p>
          </td>
        </tr>
      </table>

      <div class="navfoot">
        <hr>

        <table width="100%" border="0" summary="Footer navigation">
          <tr>
            <td width="33%" align="left"><span class=
            "footdate">$Date: 2003/02/20 08:58:18 $</span></td>

            <td width="34%" align="center"><span class=
            "foothome"><a href="index.html">Home</a></span></td>

            <td width="33%" align="right">&#160;</td>
          </tr>

          <tr>
            <td colspan="3" align="right"><span class=
            "footcopy"><span class="copyright">Copyright  1999,
            2000, 2001 Norman Walsh.</span></span></td>
          </tr>
        </table>
      </div>
    </div>
  </body>
</html>