Docbook xsl the complete guide 4th edition pdf




















With this book, you can: Select the DocBook components that are appropriate for your needs and budget. Set up and configure the tools for efficient processing of your documents.

Customize your HTML and print output. Discover and use advanced features of the DocBook stylesheets. Now available in paperback The Fourth edition is available in paperback from Amazon. This edtion is a significant upgrade over the Third Edition: Updates coverage of the DocBook stylesheets to version 1. Add coverage of tools for processing DocBook version 5 documents.

Reader comments Click here to see what others are saying about the book. Customization methods Customization layer Writing a customization layer Using a customization layer Customizing both HTML and FO Using catalogs with customizations Setting parameters Attribute sets Completing placeholder templates Generating new templates Generated text Default generated text Customizing generated text Replacing templates Finding the right template Import precedence Passing parameters Utility templates and modes Adding new templates Formatting determined by attribute value Adding processing steps Handling new elements Template selection rules Processing instructions Customizing DocBook 5 XSL DocBook 5 customization details Annotations customization Chapter Special DocBook features Chapter Bibliographies Bibliography entries Bibliography database Bibliography database catalog entry Citing bibliographic entries Numbered bibliography entries Sorting a bibliography Customizing bibliography output ISO bibliography standard Bibliography title RefDB bibliographic database Chapter Cross references Cross references within a document Linking from other elements Options for generated xref text Cross references between documents Linking to websites Breaking long URLs DocBook 5 cross references Customizing cross references Customizing with an xrefstyle attribute Modifying gentext templates Customizing cross reference behavior Customizing cross reference typography Specialized cross references Chapter Glossaries Glossary formatting Glossary formatting in print Linking to a glossary entry What about link and xref?

Setting up the tools Chapter 1. Kai-Chung Yan rated it liked it Apr 06, To see what your friends thought of this book, please sign up. To ask other readers questions about DocBook Xslplease sign up. The book is suitable for new users just getting started, as well as more advanced users needing a complete reference. Phil added it May 29, No trivia or quizzes yet. Want to Read saving…. This website uses cookies to improve your experience while you navigate through the website.

Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are as essential for the working of basic functionalities of the website.

We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. See his biography for more information. Testimonials Read the testimonials from former clients. Clients View a list of past and present clients. Training of authors or technical staff. Audience Changes in the Fourth Edition Acknowledgements The nature of publishing has changed so much over the last twenty years that anybody can be a publisher these days.

Now you can reach a world-wide audience by putting a few HTML pages up on your website. Or you can use desktop publishing software to produce beautifully typeset material that can be printed on demand or downloaded to a printer anywhere in the world.

With DocBook, you can publish both ways from the same source material. What is DocBook? DocBook is a collection of standards and tools for technical publishing. DocBook was originally created by a consortium of software companies as a standard for computer documentation.

The DTD defines the vocabulary of content elements that an author can use and how they relate to each other. For example, a book element can contain a title element, any number of para elements for paragraphs, and any number of chapter elements. The markup is similar to HTML, but with more tags and tighter rules. Text that is marked up in this standard way is can be processed by any number of software tools.

A major advantage of DocBook is the availability of DocBook tools from many sources, not just from a single vendor of a proprietary file format. You can mix and match components for editing, typesetting, version control, and HTML conversion.

You can assemble a custom system that is well suited to your needs, and many of the components are available for free. The other major advantage of DocBook is the set of free stylesheets that are available for it. The stylesheets are now developed and maintained as an open-source project on SourceForge.

An active community of users and contributors keeps up the development of the stylesheets and answers questions. As a publishing system, DocBook is best suited for any of these situations: Large quantities of content.

Highly structured content. Content that needs to be interchanged among otherwise incompatible systems. Content that needs automated batch processing. Content to be rendered in multiple output forms and versions. DocBook is hardly worth the trouble for short or one-off documents.

And since the formatting is strictly by batch process with stylesheets, DocBook is not well matched to highly designed layout-driven content like magazines. DocBook is well suited to any collection of technical documentation that is regularly maintained and published. Because you are not locked into a single vendor, you have flexibility in your choice of processes and tools, both now and in the future. Multiple authors can contribute, and their content can easily be merged because all the authors are using a standard markup language.

The files are plain text, not binary, so they also work well with most version control systems. Setting up a DocBook system will take some time and effort. But the payoff will be an efficient, flexible, and inexpensive publishing system that can grow with your needs. It is a "how to" guide that gets you up and running quickly, and then provides the details you need to gain access to the full power of DocBook. Using the built-in options to control the XSL stylesheets.

Customizing the XSL stylesheets to match your design needs. And you will need to know how to execute commands by typing them on a command line rather than through a point-and-click interface. If you know nothing about XSL, you can still use the stylesheets to generate high-quality output. You can also customize to a degree using the built-in stylesheet parameters. Learning some XSL will enable you to more fully customize the output. This book can teach you basic XSL, and provides dozens of examples that you can use and learn from.

This book will not show you how to write DocBook documents. Keep that link bookmarked for future reference. A printed and bound version of the book is also available from O'Reilly Books, but it is a bit out of date now. The online book documents the most recent version of the DTD. The Fourth Edition covers version 1. Links to websites are up-to-date as of August Updated Java product names and version numbers in Table 3. Add Chapter 4, DocBook 5 tools.

Use chunkfast. Add Table 7. Add customizing head. Add insert. Clarify xpointer scheme in Note. Add Chapter 29, Revision control. Remove the section on dbtexmath since PassiveTex no longer supported.

The author would like to thank Norman Walsh in particular for writing most of the DocBook XSL stylesheets and freely giving them to the world. His depth of technical knowledge and quality of programming skills are the main reasons the stylesheets work so well.

I learned most of my XSL from reading his stylesheets. Day, Jeff Beal, and Michael Smith, who contributed suggestions and valuable feedback on early drafts. Thanks also go to the members of the docbook-apps mailing list that sent me corrections and suggestions. Finally, I want to thank Mary the "DocBook widow" for supporting me and cheering me on during this long effort.

Setting up the tools Part I. Setting up the tools Table of Contents Chapter 1. Introduction Chapter 1. Introduction Part I. One of the major goals of XML was keeping content and its semantic markup separate from its formatting, so that formatting could be applied independently.

The stylesheets are now an open-source project maintained on SourceForge. The stylesheet distribution consists of a collection of modular XSL files that are assembled into several complete XSL stylesheets. The stylesheet collection is freely available for download. It unlocks the power of these stylesheets by documenting all of their features and making them easy to use.

Part I of this book tells you how to obtain and set up the XSL tools. It covers several XSL processors, and provides essential details for each one. It also covers XML Catalogs, which are used to map file references to actual directory locations on your system. XML Catalogs make the tools more versatile and portable. As you use the stylesheets, you will probably want to change certain aspects about the format or processing.

The DocBook stylesheets provide a large number of options. The options are in the form of stylesheet parameters, which let you assign a value to a named variable that is used in the stylesheet.

You can do quite a bit of customization of your output using just the parameters. Part II of this book describes the various stylesheet parameters and how to use them. You will turn to Part III when you want to change something but you cannot find a parameter to do it. At that point you will need to do some stylesheet customization, which is done using the XSL language. You'll need to learn the syntax and methods of XSL, so that you can write a customization file with it.

You will need a good XSL reference book to create extensive customization. Part IV of this book covers all of the special features of DocBook that require extra attention. Introduction encyclopedia of special topics, from bibliographies to websites. Use it as a reference when you need to process a certain feature, or browse it for new possibilities that you did not know DocBook could do. Note on examples Some examples of commands and code in this book are too long to fit on one line.

If you are using Microsoft Windows, you should omit the backslash character and join such a line to the following line. If you are using a Unix shell, you can use the example "as is". Introduction Online resources for finding solutions to problems If you run into problems with the DocBook XSL stylesheets that are not addressed anywhere in this guide, you can use a number of online resources to find solutions.

First try searching the archives of the docbook-apps mailing list for keywords related to the problem. There is a good chance that someone else has run into something similar. Archives of the list are available at two different sites: an archive at OASIS which also hosts the actual mailing list and an archive at Red Hat.

If, for example, you are seeing a specific error message, trying cutting and pasting the error message or some part of it into the search form for the mailing list archives. You can get help in real time on the docbook channel on irc. To subscribe to the list, send a message from your email account to: To post a message to the list, send it to: Please read the list guidelines first, and to include examples of your DocBook source document and your output for example, HTML or FO output along with details about the tools you're using including version numbers of the tools.

Note do not include attachments when you post to docbook-apps —the mailing list management software automatically strips out attachments. If you have an long example or an output format that you cannot paste into your message, post it to a Web site, and then include the URL in your message to the list.

The DocBook Wiki website collects contributions from DocBook users and makes them available to the world. If instead you want to request an enhancement to the stylesheets, file a feature request from the same Tracker page at the SourceForge site.

Note You will need to have a SourceForge user account to file a bug report or feature request. This requirement makes it easier follow up on bug reports. You can register for an account at the SourceForge site. XSL processors Chapter 2.

XSL processors Part I. Setting up the tools Chapter 2. There is a growing list of XSL processors to choose from. It can be used to rearrange the content and generate new content. It is used to find the parts of your document to apply different styles to. All XSL processors use this component.

A diagram of the DocBook Publishing Model is available if you want to see how all the components flow together. Saxon is a free processor written in Java, so it can be run on any operating system with a modern Java interpreter. The Java version is described in this book because it is highly portable and easier to set up.

It is free, as part of the open source libxml2 library from the Gnome development project. It is considered the fastest of the processors, and is highly conformant to the specification.

It is much faster than either of the Java processors. It also processes XIncludes. It is written in Java, so it runs on many platforms, and it is free. It is reported to be fast, but only runs on Windows.

It is the XSL-FO processor that actually creates the typeset lines of text and lays them out on pages. Currently there are many XSL-FO processors, but few of them have completely implemented the standard.

Typesetting is hard. The authors of the XSL-FO standard recognized how difficult it would be to implement, and so divided it into three levels of conformance: basic, extended, and complete. That way a processor can claim conformance to the lower conformance levels and produce useful output, while still be under development for the higher conformance levels. E3 High end publishing server from Arbortext, Inc. It runs on Windows and Unix.

FOP can produce usable output, but it is still under development and has some limitations. Not recommended. For Windows only. It is a Java-based product that runs on most platforms. It is a Java-based product that runs on Linux and Windows. It is written in C. It runs on Windows, Unix, and Linux. Most processor vendors can provide a summary of which XSL-FO elements and properties their processor supports. Scan the list for features you need to see if they are supported.

Such summaries are also useful in comparing different processors. Java-based processors are highly portable, as long as each platform has a modern Java interpreter. How modern depends on the individual processor and version.

Check the processor's requirements list. Processors written in C such as xsltproc and Sablotron are less portable. You need a version compiled for each platform you want to run it on. But the packaged versions can lag behind the latest version, so you may need to compile it yourself for a given platform. The C code is written to be portable, but there are always issues that come up when you have to compile. Some packages may try to install files into areas of a filesystem controlled by a system administrator.

If you do not have the necessary permissions, you may not be able to install a given package. All of the processors can be installed elsewhere, but you may need to spend time figuring out how to do so. Getting the tools working Chapter 3. Getting the tools working Part I. Setting up the tools Chapter 3. You can avoid most of those details by installing one of the already-assembled packages of DocBook tools that are available for download. The packages include most or all of the components listed above, and usually a convenience script to help you get started.

If one of those packages meets your needs, then go for it. Getting the tools working The disadvantage of such packages is that they may not keep up with the latest releases of all of the components. Each of the components follows its own development schedule, and it is hard for all of the package developers to quickly integrate each new release into a new package.

Installing your own components lets you update the components individually whenever they become available. Even if you install one of the packages, the information in this chapter can help you update individual components when you need to. Generally spaces in pathnames should be avoided where possible. As of this writing the current version is 4. If you are considering using DTD version 5. If you prefer to use the package installation software on your operating system, the DocBook DTD is also available in some package formats.

If you install from a package, you might want to note where the files install so you can refer to that path later.

You only need to reference the main file, and it will pull in the other module files to make up the complete DTD. It will work if the main DTD file is at that location. The problem with a specific reference like this is that it is not flexible. Fixing it is not a big problem if you have just a few files, but if you have hundreds of XML files, it is a tedious chore. It's also unnecessary if you use catalog files. The advantage is that the DTD is always available, as long as a web connection is available.

That makes the document very portable. This is not recommended for a slow network or flaky network connection. Even with a fast connection, it is slower than a local filesystem access. The next section shows you how to use a catalog to combine local and network access. The catalog lets you map the standard network URL to a local file.

If the catalog processor finds the local file during processing, it will use it. Otherwise, it falls back to using the network URL. With this arrangement, you get the speed of local access with the reliability and portability of network access.

If not, then the URL is used through network access. Depending on the source for your DTD download, the files that define the character entity names may not be included. Create a directory named ent in the directory where the DocBook DTD files are, and extract the entity files into ent.



0コメント

  • 1000 / 1000