Re: Creating links in Docbook 5+
Hussein Shafie <hussein <at> xmlmind.com>
2015-07-09 08:00:49 GMT
Bill D. wrote:
> Yes, you are right, XXE is not very intuitive. I have spent a lot of time studying online tutorials, using
the XXE help utility, and also searching in many of the PDF documents that are contained here:
Then may be it's time to study DocBook 5+ because your question is about
DocBook 5+ and not about XXE.
DocBook 5: The Definitive Guide
> I have learned a lot, and now know how to create links to external web pages and to send email to a particular
address. I’m using Docbook 5.0, and have installed the 5.1 update that Pixware released in late June.
> But so far I have not been able to figure out how to create a ulink that references another section of a
document. I've studied the XML code in one of your document samples, docbook-modular-book.xml, and its
children, chapter.xml, section1.xml, and section2.xml.
You should really look at demo/docbook5-sample.xml because
demo/docbook-modular-book.xml is DocBook 4 document. You are using
> How can I insert an effective ulink that works like the following code in chapter.xml?
> <para><ulink url="section1.xml">section1.xml</ulink>,</para>
> This generates the following HTML:
> <a class="ulink" href="section1.xml" target="_top">section1.xml</a>
> The document that I'm working on consists of a top level XML file that uses xi:include to reference smaller
modules. I used Edit > Reference > Insert Reference After to do this. The top level file is 070815_Pro.xml.
> Right now most of the included XML files are just "skeletons" containing only a title and a blank paragraph.
> What I'm trying to do is to add a link in the last sentence of Support_Options.xml (section 1.4). The link
should reference the section Support.xml.
> I'm attaching three XML files.
> Thank you very much for yo8ur help.
<ulink> is a DocBook 4 element which specifies an external link. <ulink>
does not exist anymore in DocBook 5+.
In DocBook 5+:
* <link linkend="TARGET_ID"> specifies an internal link.
Examples: <link linkend="MySection">, <link linkend="feature-table">.
* <link xlink:href="TARGET_URL"> specifies an external link.
Examples: <link xlink:href="http://www.xmlmind.com/xmleditor/">, <link
xlink:href="files/logs.txt"> (notice that "log.txt" is a external
resource, not an XML file which is part of the document).
In your case, you need to use <link linkend="TARGET_ID">.
Yes, you need to specify *internal* links. The fact that the link target
resides in a external file Xincluded in the master document containing
the <link> does not make it an external link.
(xi:include is just a way to organize the physical files comprising your
XML document. xi:include has no effect on the logical contents of your
XML document. That is, with or without xi:includes, the logical contents
of your XML document is the same.)
Therefore, the procedure is:
1) Add an xml:id attribute to the section which is the target of the
link. To the <section>, not to its <title>.
2) Use the toolbar button "Toggle link[linkend]" to create the internal
link. (Toolbar buttons are your friends:
3) Set the linkend attribute of the newly created <link linkend="???"/>
to the xml:id of the target section.
The fact that the section is possibly stored in a separate file makes
specifying its xml:id slightly more difficult.
You can either:
* Type the target ID (because you know it by heart) using the Attributes
* Use the "Edit" button of the Attributes tool to display a chooser
dialog box. Then expand the "Filters" section of the chooser dialog box
to select the file containing the section.
* Open a "Navigation Pane" for the master document. This will create a
``flat space of IDs'' for all the modules x:included in the master document.
> P.S. — Is it possible to create text that is both bold and italic? One online forum suggested that
<emphasis role="bold-italic"> should work, but XXE does not appear to accept that tag.
We have never heard about <emphasis role="bold-italic">. If this role is
supported by the DocBook XSL stylesheets, then we'll of course support
it too in XXE.
Meanwhile it's always possible to use the Attributes tool and type
"bold-italic" (but this role value will have no effect on what's
rendered on screen).
XMLmind XML Editor Support List
xmleditor-support <at> xmlmind.com