Editing Documents in Docbook Dave Leblanc

Total Page:16

File Type:pdf, Size:1020Kb

Editing Documents in Docbook Dave Leblanc Editing Documents in Docbook Dave LeBlanc This document is a Docbook book of articles and should only be edited as such in ~sysadmin/docs/RecoveryBible/EditingDocuments.xml December 20, 2008 Table of Contents 1. Philosophy ..................................................................................................................... 1 1.1. Types of documentation ........................................................................................ 2 2. Methodology .................................................................................................................. 2 2.1. Tools needed ....................................................................................................... 2 3. Procedure ...................................................................................................................... 3 A. Using XMLmind XML Editor .......................................................................................... 4 1. Starting XXE ......................................................................................................... 4 2. Creating a new document ......................................................................................... 5 3. Inserting elements ................................................................................................... 6 4. Selecting elements .................................................................................................. 8 4.1. The implicit element selection ........................................................................ 9 4.2. The text selection ......................................................................................... 9 4.3. The node selection ........................................................................................ 9 5. Navigating through elements ................................................................................... 11 5.1. Using Tab to go from a #text to the other, just like in a form ............................ 11 5.2. XXE makes a difference between the end of a #text node and the beginning of the #text node next to it .................................................................................. 12 6. Copy, cut, paste, delete .......................................................................................... 13 6.1. Copy, cut, paste, delete applied to the text selection .......................................... 13 6.2. Copy, cut, paste, delete applied to the node selection ......................................... 13 7. Splitting and joining elements ................................................................................. 14 7.1. Simple Split and Join .................................................................................. 14 7.2. Split and Join generalized ............................................................................. 15 8. Replacing elements ................................................................................................ 16 9. Converting elements .............................................................................................. 19 9.1. Convert applied to the text selection ............................................................... 19 9.2. Convert applied to the node selection ............................................................. 20 10. Editing element attributes ...................................................................................... 20 10.1. Required attributes in newly created elements ................................................. 22 11. Checking document validity .................................................................................. 23 1. Philosophy Documentation is the keystone to continuity. Continuity serves well in emergency situations when panic mode arises and little thought is required, or when asked to fill a position and perform a duty that is not familiar. Documentation may also be viewed as a method to efficiency, giving the reader to ability to spot inconsistencies or discrepancies in processes, methods and procedures. At the very least, documentation serves as a reminder of something important to the reader. 1 Editing Documents in Docbook 1.1. Types of documentation Technical documentation involves basically three types of documentation: web-only, offline-only, and hybrid. • Web-only consists of information that needs to be updated with some frequency, but only readily available within a webpage. • Offline-only consists of information that needs to be available when the servers containing important information are broken for whatever reason; e.g., disaster recovery procedures. Documentation classified as offline-only is as such for process simplification -- each time a document is updated it is then printed, to avoid having copies in multiple locations. This reduces the number of invalid/stale copies of documentation. • Hybrid documentation is the information available online for the sake collaborative editions/changes with the added feature of having nicely printed copies on demand; e.g., a list of machines and their dependancies, a procedure describing shutdown order of a cluster. This type of documentation is sometimes required to be available online and offline, depending on what is being done with the information therein. For our purposes here, we will only focus on offline-only and hybrid. 2. Methodology Docbook provides a framework for creating technical documentation with the ability to output multiple different formats from a single XML source. This fits the philosophy of having multiple types of documentation while enabling the editor/author to have one master source document. With a Docbook XML document, the editor/author can specify via XSLT stylesheet how each output format will appear in its published form. There are many default Docbook XSLT stylesheets available, allowing an author to fully customize each published result. The author/publisher of a document may create webpages, manpages, Postscript, PDFs, etc. using a few simple tools on the single source document. Further, multiple documents may be included (XInclude) into a single document, resulting in a master source of documentation concerning a given subject. Couple this powerful publishing framework with a revision control system, and the result is a documentation system capable of tracking changes within the contents of documents. 2.1. Tools needed • A general understanding of the DocBook markup language (similar to how you need to have knowledge of HTML when editing webpages) • A DocBook-aware XML editor (you may use a non-DocBook editor, but that requires you know Docbook tags) XMLmind XML Editor is currently the most widely used. [see Appendix A for more info] • DocBook XSL stylesheets These are readily available, and can be downloaded from Sourceforge [http://sourceforge.net/projects/ docbook], but are also included with XMLmind XML Editor. • A general understanding of how DocBook XSL is employed. [ see http://www.sagehill.net/ docbookxsl/index.html ] 2 Editing Documents in Docbook • An XSL processor • SAXON SAXON is a Java command-line program that provides a set of services for converting XML data into other formats. SAXON is capable of converting XML documents into HTML (single page, or multi-page), Java Help, Microsoft Windows Help, XHTML (single or multi-page), and Formatting Objects (FO) which is an intermediary format that can then be transformed into PDF or RTF. • Xalan Xalan is part of the Apache XML Project. It has versions written in both Java and C++, both of them free. Generally Xalan is used with the Xerces XML parser, also available from the Apache XML Project. • xsltproc 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, and is capable of handling XInclude. • An XSL-FO processor FOP is part of Apache's XML project and is the world's first print formatter driven by XSL formatting objects (FO) and the world's first output independent formatter. It is a Java application that reads a formatting object tree (as e.g. generated by SAXON) and then renders the resulting pages to a specified output. Output formats currently supported are PDF, PCL, PS, SVG, XML (area tree representation), Print, AWT, MIF and TXT. Since the primary output target is PDF we will use FOP for PDF formatting. • A Revision Control System is usually beneficial to track changes to important documents with the ability to revert documents to their previous state. 3. Procedure 1. If source document is under revision control, make sure it is checked out. 2. Edit the source XML document with a Docbook editor, such as XMLmind XML Editor Personal Edition [http://www.xmlmind.com/xmleditor] [see Appendix A for more precise instructions on XMLmind XML Editor] 3. Save the resulting Docbook XML file. 4. If souce XML document is under revision control, or should be, check the file in. 5. If the document includes (XInclude) portions of other documents, use xmllint to create a full normalized XML source that resolves the include statements (this is not necessary if using xsltproc): xmllint --xinclude masterfile.xml > full_target.xml Note xmllint usually comes packaged with libxml2-utils, and in this particular use it simply locates and combines all the included portions of linked documents 6. In this step, we process the xml file with the xsl stylesheet to produce FO output. 3 Editing
Recommended publications
  • XML a New Web Site Architecture
    XML A New Web Site Architecture Jim Costello Derek Werthmuller Darshana Apte Center for Technology in Government University at Albany, SUNY 1535 Western Avenue Albany, NY 12203 Phone: (518) 442-3892 Fax: (518) 442-3886 E-mail: [email protected] http://www.ctg.albany.edu September 2002 © 2002 Center for Technology in Government The Center grants permission to reprint this document provided this cover page is included. Table of Contents XML: A New Web Site Architecture .......................................................................................................................... 1 A Better Way? ......................................................................................................................................................... 1 Defining the Problem.............................................................................................................................................. 1 Partial Solutions ...................................................................................................................................................... 2 Addressing the Root Problems .............................................................................................................................. 2 Figure 1. Sample XML file (all code simplified for example) ...................................................................... 4 Figure 2. Sample XSL File (all code simplified for example) ....................................................................... 6 Figure 3. Formatted Page Produced
    [Show full text]
  • Multiple Outputs Why Single-Source?
    Sagehill Enterprises Single-source Publishing with What is Single-source DocBook XSL Publishing? ►Multiple outputs from single source file. ►Reusable content. Bob Stayton ►Modular writing. ►Assembled documents. Sagehill Enterprises ►“Write once, publish many”. DocBook Consulting http://www.sagehill.net email: [email protected] 831-566-8239 17 August 2005 Single-source Publishing with DocBook XSL 1 17 August 2005 Single-source Publishing with DocBook XSL 2 Multiple outputs Why Single-source? ►Print, PDF, HTML, slides, Help files. ►Reduce redundant writing. ►Different product versions. ►Writers can specialize. ►Different user levels. ►Update in a single place. ►Sight-impaired, WML, text-only. ►Users get more accurate information. ►Fewer words to translate. 17 August 2005 Single-source Publishing with DocBook XSL 3 17 August 2005 Single-source Publishing with DocBook XSL 4 What is DocBook? Why use DocBook? ►DTD for technical documentation. ►Designed for technical documentation. ►Related stylesheets and tools. ►Content kept separate from format. ►Started in 1991 as SGML, now XML. ►Open to computer processing. ►OASIS standard since 1998. ►Choose your publishing tools. ►Cross platform ►Automate your processing. 17 August 2005 Single-source Publishing with DocBook XSL 5 17 August 2005 Single-source Publishing with DocBook XSL 6 Copyright 2005 Bob Stayton 1 Sagehill Enterprises What’s the downside? Best for … ►XML learning curve. ►Multiple output formats. ►Investment in setup. ►Multiple releases over time. ►Technical staff needed. ►Large documentation sets. ►Batch processing environment. ►Shared authoring. 17 August 2005 Single-source Publishing with DocBook XSL 7 17 August 2005 Single-source Publishing with DocBook XSL 8 Who uses DocBook? What do you need? ► Sun ►DocBook DTD (XML version).
    [Show full text]
  • Editing Docbook V5.0
    DocBook V5.0 The Transition Guide 27 October 2005 This version: http://docbook.org/docs/howto/2005-10-27/ Latest version: http://docbook.org/docs/howto/ Authors: Jirka Kosek, <[email protected]> Norman Walsh, <[email protected]> Table of Contents Introduction ........................................................................................................................................ 1 Finally in a namespace .................................................................................................................. 2 Relaxing with DocBook ................................................................................................................ 2 Why switch to DocBook V5.0? ...................................................................................................... 3 Schema jungle ............................................................................................................................ 3 Toolchain ........................................................................................................................................... 4 Editing DocBook V5.0 .................................................................................................................. 4 Validating DocBook V5.0 .............................................................................................................. 9 Processing DocBook V5.0 ........................................................................................................... 10 Markup changes ...............................................................................................................................
    [Show full text]
  • Xmlmind XSL Utility - Online Help
    XMLmind XSL Utility - Online Help Hussein Shafie, XMLmind Software <[email protected]> February 23, 2021 Table of Contents 1. Overview ................................................................................................................................ 1 2. Running XMLmind XSL Utility ............................................................................................... 3 2.1. System requirements ..................................................................................................... 3 2.2. Installation ................................................................................................................... 3 2.3. Contents of the installation directory .............................................................................. 3 2.4. Starting XMLmind XSL Utility ..................................................................................... 4 2.5. XMLmind XSL Utility as a command-line tool .............................................................. 5 3. Converting an XML document to another format ....................................................................... 6 3.1. Canceling the current conversion process ....................................................................... 7 4. Changing the parameters of a conversion .................................................................................. 8 5. Specifying a conversion ......................................................................................................... 10 5.1. Specifying the conversion
    [Show full text]
  • Release Notes for the Docbook XSL Stylesheets I
    Release Notes for the DocBook XSL Stylesheets i Release Notes for the DocBook XSL Stylesheets Release Notes for the DocBook XSL Stylesheets ii Contents 1 Release Notes: snapshot 1 2 Release Notes: 1.79.2 1 3 Release Notes: 1.79.1 1 3.1 Gentext . .1 3.2 Common . .2 3.3 FO...........................................................4 3.4 HTML.........................................................9 3.5 Manpages . 13 3.6 Epub.......................................................... 14 3.7 HTMLHelp . 16 3.8 Eclipse . 16 3.9 JavaHelp . 16 3.10 Slides . 17 3.11 Website . 17 3.12 Webhelp . 18 3.13 Params . 18 3.14 Profiling . 20 3.15Lib........................................................... 20 3.16 Tools . 20 3.17 Template . 21 3.18 Extensions . 21 4 Release Notes: 1.79.0 21 4.1 Gentext . 22 4.2 Common . 23 4.3 FO........................................................... 24 4.4 HTML......................................................... 29 4.5 Manpages . 34 4.6 Epub.......................................................... 35 4.7 HTMLHelp . 36 4.8 Eclipse . 36 4.9 JavaHelp . 37 4.10 Slides . 37 4.11 Website . 38 4.12 Webhelp . 38 4.13 Params . 39 Release Notes for the DocBook XSL Stylesheets iii 4.14 Profiling . 40 4.15Lib........................................................... 40 4.16 Tools . 40 4.17 Template . 41 4.18 Extensions . 42 5 Release Notes: 1.78.1 42 5.1 Common . 42 5.2 FO........................................................... 43 5.3 HTML......................................................... 43 5.4 Manpages . 44 5.5 Webhelp . 44 5.6 Params . 44 5.7 Highlighting . 44 6 Release Notes: 1.78.0 44 6.1 Gentext . 45 6.2 Common . 45 6.3 FO........................................................... 46 6.4 HTML......................................................... 47 6.5 Manpages .
    [Show full text]
  • An XML Format for Proteomics Database to Accelerate Collaboration Among Researchers
    AO HUPO workshop in Tsukuba (Dec. 19, 2002) An XML Format For Proteomics Database to Accelerate Collaboration Among Researchers HUP-ML: Human Proteome Markup Language K. Kamijo, H. Mizuguchi, A. Kenmochi, M. Sato, Y. Takaki and A. Tsugita Proteomics Res. Center, NEC Corp. 1 Overview (HUP-ML) z Introduction z XML features z XMLs in life science z HUP-ML concept z Example of HUP-ML z Details of HUP-ML z Demonstration of “HUP-ML Editor” 2 Introduction z Download entries from public DBs as a flat-file z easy for a person to read z different formats for every DB z sometimes needs special access methods and special applications for each format z Needs machine-readable formats for software tools z To boost studies by exchanging data among researchers Activates standardization 3 XML format z XML (eXtensible Markup Language) W3C: World Wide Web Consortium (inception in 1996) Attribute Key Value Example Element Start Tag <tag_element_source attribute_growth=“8 weeks”> rice leaf </tag_element_source> End Tag z Highly readable for machine and person z Can represent information hierarchy and relationships z Details can be added right away z Convenient for exchanging data z Easy to translate to other formats 4 z Logical-check by a Document Type Definition (DTD) Overview (HUP-ML) z Introduction z XML features z XMLs in life science z HUP-ML concept z Example of HUP-ML z Details of HUP-ML z Demonstration of “HUP-ML Editor” 5 XML features z Exchangeable z Inter-operability: z OS (Operating System): Windows, Linux, etc. z Software Development Languages
    [Show full text]
  • Download Chapter W3: Working with XML Documents
    0789734273_W3.qxd 1/3/07 1:54 PM Page Web:75 CHAPTER W3 Working with XML Documents In this chapter Understanding XML 76 Creating an XML Document 78 Formatting an XML Document 84 Publishing an XML Document 89 Understanding Advanced XML Tasks 90 Troubleshooting 94 0789734273_W3.qxd 1/3/07 1:54 PM Page Web:76 Web:76 Chapter W3 Working with XML Documents Understanding XML XML—it seems to be all the rage these days. Nearly any up-to-date software product touts its XML capabilities as if you already knew what it is and why it’s important to you. We can’t promise that you’ll understand XML completely by the time you finish this chapter, but we do hope you’ll have a better idea as to what XML is and how you can use it in practical ways. In a nutshell, XML is Extensible Markup Language, a method for defining document informa- tion and making it easy to transmit or reuse that information, without regard to proprietary software or operating systems. What’s in XML for You Before jumping into definitions for XML, you probably want to know whether it’s necessary or even worth the effort to learn about XML. W3 Honestly? For most individual work, using XML is of little intrinsic value or interest. If you work on your own, and creating good-looking documents for printing is your primary use for WordPerfect, you do not need to read much further, unless, of course, you’d like to know what the fuss is all about.
    [Show full text]
  • Oxygen XML Editor 12.2
    Oxygen XML Editor 12.2 Oxygen XML Editor | TOC | 3 Contents Chapter 1: Introduction................................................................................17 Key Features and Benefits of Oxygen XML Editor ..............................................................................18 Chapter 2: Installation..................................................................................21 Installation Requirements.......................................................................................................................22 Platform Requirements...............................................................................................................22 Operating System.......................................................................................................................22 Environment Requirements........................................................................................................22 JWS-specific Requirements.......................................................................................................22 Installation Instructions..........................................................................................................................23 Windows Installation..................................................................................................................23 Mac OS X Installation................................................................................................................24 Linux Installation.......................................................................................................................24
    [Show full text]
  • Using Docbook and XML Technologies to Create Adaptive Learning Content in Technical Domains1
    Using DocBook and XML Technologies to Create Adaptive Learning Content in Technical Domains1 Iván Martínez-Ortiz 1, Pablo Moreno-Ger 2, José Luis Sierra- Rodríguez 2 and Baltasar Fernández-Manjón 2 1 Centro de Estudios Superiores Felipe II. Aranjuez, Spain 2 Universidad Complutense de Madrid. Madrid. Spain e-mail: [email protected], {pablom, jlsierra, balta}@fdi.ucm.es Abstract This work presents an XML-based authoring methodology that facilitates the different tasks associated with the development of standards-compliant e-learning content development. The idea is to support a unified authoring process of adaptive e-learning content by adopting the manual writing metaphor. According to this metaphor, which is specially well-suited for technical domains, instructors are compelled to view e-learning material as the manuals normally written and used to teach a particular subject. The methodology is supported by the DocBook document model (an XML application) which has a number of tools associated that facilitate the implementation of the methodology. Other tasks such as the packaging of contents or publishing in the Learning Management System (LMS) can be automated from these manuals. Keywords: XML, Adaptive learning, e-Learning, interoperability, profiling, adaptation. 1. INTRODUCTION Historically, the production and maintenance of educational contents has required great investment and the employment of multidisciplinary groups of experts. But technological evolutions (i.e. from CD-ROM to Internet technologies) or migrations to different e-learning platforms can make that content obsolete without any possibilities of reuse. In addition, these contents are usually designed as indivisible blocks and this affects reusability between different authors, projects or target audiences.
    [Show full text]
  • Using the Docbook XSL Stylesheets
    Single-source Publishing with DocBook 4 Bob Stayton Sagehill Enterprises What is Single-source Publishing? ►Multiple outputs from single source file. ►Reusable content. ►Modular writing. ►Assembled documents. ►“Write once, publish many”. Single-source Publishing with DocBook 4 2 Multiple outputs ►Print, PDF, HTML, slides, Help files. ►Different product versions. ►Different user levels. Single-source Publishing with DocBook 4 3 Separate content from formatting ►XML file has no formatting. ►Separate stylesheets supply formatting. ►Match formats to element names Single-source Publishing with DocBook 4 4 Why Single-source? ►Reduce redundant writing. ►Writers can specialize. ►Update in a single place. ►Users get more accurate information. ►Fewer words to translate. Single-source Publishing with DocBook 4 5 What is DocBook? ►XML for technical documentation. ►Related stylesheets and tools. ►Started in 1991 as SGML, now XML. ►OASIS standard since 1998. Single-source Publishing with DocBook 4 6 Like HTML, except: ►A lot more tags. ►Tags identify document parts. ►All tags must be closed (or empty). ►No style information. Single-source Publishing with DocBook 4 7 Why use DocBook? ►Designed for technical documentation. ►Content kept separate from format. ►Quality check through validation. ►Open to computer processing. Single-source Publishing with DocBook 4 8 More reasons ►Choose your publishing tools. ►Cross platform. ►Automate your processing. Single-source Publishing with DocBook 4 9 Standard publishing features ►Front matter ►Graphics ►Tables ►Glossaries ►Bibliographies ►Indexes Single-source Publishing with DocBook 4 10 Technical publishing ►Nested section levels. ►Numbered figures, tables, examples. ►Tasks and procedures. ►Code synopses. ►Code examples. ►Running headers and footers. Single-source Publishing with DocBook 4 11 Free DocBook stylesheets ►Stylesheets for multiple outputs.
    [Show full text]
  • Xmlmind XML Editor - Support of Docbook 5.1 Assemblies
    XMLmind XML Editor - Support of DocBook 5.1 Assemblies Hussein Shafie, XMLmind Software <[email protected]> June 22, 2021 Abstract This document describes the commands which are speci®c to DocBook 5.1 assemblies. Table of Contents 1. Why read this document? ......................................................................................................... 1 2. The Assembly menu ................................................................................................................ 2 2.1. The "Convert Document" sub-menu ............................................................................. 5 3. The Assembly toolbar ............................................................................................................. 8 3.1. The "Edit Module" dialog box .................................................................................... 11 3.2. The "Edit or Add Relationship" dialog box ................................................................. 13 4. Custom bindings .................................................................................................................... 15 1. Why read this document? This document describes the support of DocBook 5.1 assemblies in XMLmind XML Editor. It does not deal with DocBook 5.1 elements which are not related to the assembly element, that is, book, chapter, section, topic, etc. How to create and edit these elements in XMLmind XML Editor is documented in another document: XMLmind XML Editor - DocBook Support. The content of this other document applies
    [Show full text]
  • Institutionen För Datavetenskap Department of Computer and Information Science
    Institutionen för datavetenskap Department of Computer and Information Science Master’s thesis CUSTOMIZATION OF DOCBOOK TO GENERATE PDF, HTM & CHM by Muhammad Asif LIU-IDA/LITH-EX-A--09/053--SE Linköping, 2009 Linköpings universitet Linköpings universitet SE-581 83 Linköping, Sweden 581 83 Linköping Datum Avdelning, institution Date Division, department Institutionen för datavetenskap Department of Computer and Information Science 2009 -10 -20 Linköpings universitet Språk Rapporttyp ISBN LIU-IDA/LITH-EX-A--09/053--SE Language Report category Svenska/Swedish Licentiatavhandling ISRN LIU-IDA/ X Engelska/English x Examensarbete C-uppsats Serietitel och serienummer ISSN D-uppsats Title of series, numbering Övrig rapport URL för elektronisk version Titel Title CUSTOMIZATION OF DOCBOOK TO GENERATE PDF, HTM & CHM Författare Author Muhammad Asif Sammanfattning Abstract Software documentation is an important aspect of software projects. Software documentation plays a key role in software development if it is up-to-date and complete. Softwa re documentation should have the synchronization with the software development. One of the problems is duplication; same information is written in different documents and stored in different places with different formats making things complex to manage. By using traditional documentation tools, it’s hard to maintain documentation for complex systems and it is time consuming. To overcome these problems, we have used XML Docbook that is a good solution for it. Docbook provides single sourcing technique in whi ch documents are written ideally in one place and can convert it into different other formats from the same location. Actually docbook is based on xml which can be easily edited by most of the programming languages.
    [Show full text]