Chapter 3. Manipulating DocBook Document Structure
DocBook files can be created manually or by tools. Sometimes tools create a structure which is inconvenient for some reasons or you have legacy documents which contain the “wrong” structure. This chapter shows how to restructure your DocBook document in the way you want.
- 3.1. Introduction
- 3.2. Pretty-Printing DocBook Documents
- 3.3. Converting DocBook from Version 4 to Version 5
- 3.4. Converting DocBook from Version 5 to Version 4
- 3.5. Splitting DocBook Documents
- 3.6. Extracting One Element from DocBook Document
- 3.7. Transforming
sectX
Elements intosection
Elements - 3.8. Transforming
section
Elements intosectX
Elements - 3.9. Transforming
bridgehead
Elements intosection
Elements - 3.10. Moving Block Elements Outside of Paragraphs
- 3.11. Adding Index Entries (Semi-)Automatically
- 3.12. Including Revision Information from Version Control Systems
- 3.13. Creating an Acronym List
- 3.14. Splitting DocBook 5 Documents Into Topics
- 3.15. Assembling Topics
- 3.16. Creating an Assembly File Manually
- 3.17. Using Entities as Placeholders
- 3.18. Preserving Entities
3.1. Introduction
The methods described in this chapter are mostly XSLT solutions where you can find more or less in any XSLT book. Actually, some ideas origin from SalMangano´s excellent XSLT Cookbook. However, the solutions in this chapter are targeted exclusively on DocBook.
Most of these solutions are based on an identity
transformation stylesheet which is shown in Example 3.1, “copy.xsl
”.
This simple stylesheet copies everything from the input document to the output document without any modifications. Although it seems quite useless at a first glance, it reveals its full power when combining it with customizations.