Linking to websites Creating a link from your DocBook document to a website is easy. The first ulink example is not empty, so its text content becomes the hot text in HTML output. The second ulink is empty, so the stylesheet will automatically copy its URL to use as the hot text. In HTML output, you can have the target document appear in a separate window if you set the ulink. That adds a target attribute to the HTML anchor tag.
|Published (Last):||20 April 2009|
|PDF File Size:||12.7 Mb|
|ePub File Size:||18.35 Mb|
|Price:||Free* [*Free Regsitration Required]|
While it is not a radical change in terms of element names and structures, it signficantly changes the foundation on which DocBook is based. DocBook 5 differences These are the major changes included in DocBook 5. They are each described in more detail in the following sections. DocBook namespace. This allows elements from other namespaces to be mixed into DocBook documents without creating element name conflicts.
Likewise, DocBook fragments can more easily be embedded in other compound document types. RelaxNG schema. RelaxNG permits an element in different contexts to have different content models. Universal linking. In DocBook 4, only a few elements like link and xref were used to form links. In DocBook 5, most elements that generate some output can be made into a link.
The link can go to an internal or external destination. Also, the id attribute in DocBook 4 is replaced with the xml:id attribute. Unform metadata elements. In DocBook 5, elements from DocBook 4 such as bookinfo, chapterinfo, sectioninfo, etc. The element may have different content models in different contexts, to manage titled and non-titled elements, for example.
DocBook 5 introduces a general purpose annotation mechanism that allows you to associate information with any element. A namespace attribute may optionally define a namespace prefix, and then the elements in that namespace must use the prefix on the element name.
Note that the root element is now d:book, and all other DocBook elements in the document must also have the d: prefix on their names in both opening tags and closing tags of elements. When a namespace attribute has no prefix, the namespace becomes the default namespace. A namespace attribute on an element means that the namespace is in scope for that element and all of its descendants. That does not necessarily mean those elements are in the namespace, just that the namespace is recognized.
That includes the special case of the default namespace when the attribute does not define a prefix, in which case any element that is in scope and without a prefix is in that namespace.
Setting the namespace as the default namespace is usually more convenient when creating an entire document in a single namespace, as is typically done with DocBook. If you put a default namespace attribute on the root element, then the namespace is in scope for all elements, and all elements without a prefix are in the namespace. Of course, just adding a namespace declaration may not make a DocBook 4 into a valid DocBook 5 document.
There are differences in elements and content models between the two versions, so some fixup may be required. Fortunately, a guide and conversion stylesheet exist to help transition DocBook 4 documents to DocBook5. First consult DocBook V5. It provides guidelines for conversion and describes the db4-upgrade. An XML schema defines the element and attribute names, and the rules for how they are combined into documents. Its major advantages for use as the official DocBook schema include: It handles namespaces.
It allows the content model of an element to be different when that element is in different contexts. It is relatively easy to read in its compact form. It is quite easy to customize in order to extend or subset the DocBook schema. These other versions contain the same element and attribute names. However, in each of these other versions, certain features of the schema are lost. For example, the DTD version does not permit an element to have different content when the element appears in different contexts.
The disadvantages of using RelaxNG include the following: No support for entity declarations. Fewer tools for validation. Universal linking in DocBook 5 In DocBook 4, only specialized elements are used for creating links within and between documents.
In DocBook 4, you can use xref or link with linkend attributes to form links within a DocBook document, you can use olink to form links between DocBook documents, and you can use ulink to form an arbitrary URL link. In DocBook 5, almost all elements can be used as the basis for a link. For example, you can turn a command element into a link that targets the reference page for the command. That standard says that any XML element can become the source or target of a link if it has the universal XLink attributes on it.
Because these attributes are in their own namespace, they do not interfere with any native attributes declared for an element. This is similar to the DocBook 4 link and xref elements.
The link and xref elements were retained in DocBook 5. This is similar to the DocBook 4 ulink element, which was removed in DocBook 5. Instead of ulink, use a link element with a URL in its xlink:href attribute. An olink-style link from any element can be formed using two attributes. The olink element itself is retained in DocBook 5.
At the same time, the familiar DocBook linking attribute linkend has also been added anywhere an XLink can be used. The linkend attribute is limited to linking to an xml:id target within the same document. The universal linking mechanism enables you to create logical links between any two DocBook elements. However, such logical links may or may not be expressible in formatted output.
For example, if you put an xlink:href on an inline element, then the text of the inline element can become clickable link text in the output. However, if you put an xlink:href attribute on a block element such as section, then it is doubtful that making all the text in the section into a clickable link will be useful.
The DocBook stylesheets currently only handle xlink:href on inline elements for this reason. If you want to express linking from a block element, you will have to customize the stylesheet to do so, perhaps by putting a clickable icon in the margin. The middle column shows DocBook 4 syntax, and the right columns shows DocBook 5 syntax. In DocBook 5, many links can be done in more than one way. DocBook 5 linking examples.
DOCBOOK ULINK PDF
Kamuro The way it works is you set the stylesheet parameter ulink. DocBook 5 has a new system for associating annotations with elements. The universal linking mechanism enables you to create logical links between any two DocBook elements. For example, if you put an xlink: In DocBook 5, most elements that generate some output can be made uulink a link. The link element contains some text or even other elements: Usually, external links are used in two ways:. If you also set the parameter ulink. It is quite easy to customize in order to extend or subset the DocBook schema.
Usually, Link surrounds the text that should be made "hot," unlike XRef which must generate the text but the EndTerm attribute can be used to copy text from another element. Processing expectations Formatted inline. If the Link element specifies an EndTerm, and then the content of the element pointed to by EndTerm should be repeated at the location of the Link and used as the "hot" text instead of the Link content, which should be suppressed. Linking elements must not be nested within other linking elements including themselves. The processing of nested linking elements is undefined. It will no longer be available in the content model of this element.