Freebsd Laptop Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, 21 June 2012

Getting started with DocBook using XML Copy Editor

Posted on 07:50 by Unknown
Category: Techwriter
If you're only getting started with a markup language like DocBook, XML editors can be helpful in learning the different elements, tags, and attributes available in the language.  However, editors won't teach you to write markup and you would still need a reference such as the online Definitive DocBook Guide .  That said, XML Copy Editor, available for Linux and Windows, is a popular XML editor used by enthusiasts and professionals and can be a great tool for learning DocBook.
Before beginning, it's important to note that you may still prefer a plain text editor especially if you're accustomed to Notepad+, Gedit,Vim, or Kwrite.   Using an XML editor can be intrusive and difficult to get used to at first but it's a good stepping stone if you want to learn how to author quickly. 
Setting up XML and Adding a DocBook Declaration
Before beginning, determine if you want to write an earlier DocBook 4.x version or the somewhat newer DocBook 5.x.  To understand the difference, visit the OASIS site or the overview found in the Definitive DocBook Guide. For this tutorial, we will be focusing on Docbook XML Version 5.0b3.  After launching XML Copy Editor, follow the steps below to begin writing your first DocBook file:
1. Click File and then New.
2. In the New Document window, select DocBook 5.0b book (*.xml).
3. XML Copy Editor will open a new document tab.  Click File then Save As... By default, XML Copy Editor will not add a file extension, so type a filename with the .xml extension.
4. On the document window, line 2 indicates the OASIS URL  path for the DTD.  If you're using a different DTD for your document, such as docbookx.dtd, then change or modify the path.   Visit the Docbook.org or the OASIS web site for more details and a list of the available DTD's or ask your school, organization, or company which DocBook DTD they use.  Think of DTD as a pattern your document has to follow strictly in order to be considered a legitimate DocBook file. 
At this point, it's important to note that if you want to validate your DocBook document with the publicly available DTD, you should be connected to the Internet.  XML Copy Editor uses the URL in line 2 to check if your document  followed the rules and structure of that version of DocBook.
Validating the Document
Even without changing XML Copy Editor's template, you can already validate the document with the 5.0b3 DTD. 
To validate the document with the DocBook DTD defined in your declaration using XML Copy Editor:
1. Click the green checkmark on the control bar or click XML, Validate, then DTD/XML Schema.  Alternately, click F5.
2. A message will be displayed in the Information box found at the bottom of the editor. 
3. As you start writing your document and using your DocBook reference, you would want to validate the DocBook every now and then to make sure you used the write tags and followed proper child and parent structure and sequence.
Adding Elements
1. The template XML Copy Editor provides is a great way to get started but obviously, there are many more tags available in DocBook.  For this example, we will remove the Appendix and Legal Notice tags.

2. After filling out the title and author, we're going to add the publisher.  According to our DocBook reference, publisher information is found under the <info> tag and can be followed with a <publishername> and <address>.
3. Press the Return key after the close tag </author> to create a new line.  Type <   and XML Copy Editor will display a list of possible tags that can be used under the <info> tag.  Select publisher.
4. Press > and XML Copy Editor will automatically place a close tag </publisher>. 

5. Press the Return key and press tab.  This "nests" the next set of information within the <publisher> tag.

6. Use the same process to add the <publishername> information and <address> which are all child elements of the <publisher> tag.
Adding Attributes
1. We will now add the label attribute for the first <chapter> tag.

2. Press the spacebar after <chapter and XML Copy Editor will display a list of possible attributes for the <chapter> tag. 
3. Select label and type = and XML Copy Editor will immediately add quotation marks.  Type your chapter label.
Well-Formed and Validated
To check if the XML was written based on XML rules and syntax, click on the Blue checkmark on the control panel or press F2.  Alternately, click XML and then Check for Well-formedness . The Information box will display an error or indicate if the document is well-formed.
Validate the document to the DocBook DTD again by clicking F5.
You have successfully created your first XML DocBook file and well on your way to using XML Copy Editor and DocBook for future projects.  XML Copy Editor has many more functions to try out and supports a variety of standards while providing useful tools like checking the Xpath and associating stylesheets.   It's a great way to learn various types of markup language even if you eventually plan to use a plain text editor, Terminal-based editors, or applications like Bluefish.
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in Techwriter | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Drawing a Rounded Triangle in CorelDraw
    Category: Tech Writer If you need to draw a safety icon such as those found in user manuals or any icon which requires a rounde...
  • Linux on Film: The Amazing Spider-Man (2012) Part 1
    Ok, for dedicated fans of the latest Spider-Man movie (me included), Sony made use of this brilliant flick to advertise their Sony ...
  • Tech Flashback: The Lethal Weapon series 1987 - 1998 Part 3
    Category: Tech Today Continued from Tech Flashback: The Lethal Weapon series 1987 - 1998 Part 2 In this series of articles, we continue our ...
  • CorelDRAW X5: Adding Barcodes and QR Codes to Business cards Part 2
    QR Codes and QR Code Services Due to the popularity of QR Apps that can be installed on smartphones and iOS devices, QR codes are also becom...
  • Linux on Film: Antitrust (2001)
    *All screencaps from Antitrust (2001 ) Long-time Linux users are familiar with Antitrust (2001), which was strongly adverti...
  • CorelDraw Basics: Exporting to SVG for HTML5 web pages
    Category: Techwriter There are advantages to using SVG over the more popular PNG or JPEG when working with technical ...
  • Sony RAW (.ARW) support on openSUSE KDE
    Category: Linux Some advanced digital cameras and ILCs supports the RAW format, which many serious photographers prefer over JP...
  • Knoppix LiveUSB Basics: Bluetooth and Blueman Part 1
    Although Bluetooth has never been as reliable as a wired or RF connection, adding Bluetooth to an old machine is a simple way ...
  • Linux on Film: The Amazing Spider-Man (2012) Part 2
    Piezoelectric technology and microcontroller From a plot perspective, Peter probably made use of existing equipment like th...
  • Microsoft Product Placement in Arrow Season One Part 1
    Note: Unsolicited But Offered normally features Linux on film but in celebration of the ongoing season 2 of Arrow (w...

Categories

  • Linux
  • Linux - Mandriva
  • Linux - openSUSE
  • Tech Today
  • Techwriter
  • Travel Logs

Blog Archive

  • ►  2013 (229)
    • ►  November (19)
    • ►  October (21)
    • ►  September (20)
    • ►  August (23)
    • ►  July (23)
    • ►  June (21)
    • ►  May (24)
    • ►  April (22)
    • ►  March (19)
    • ►  February (16)
    • ►  January (21)
  • ▼  2012 (261)
    • ►  December (28)
    • ►  November (22)
    • ►  October (28)
    • ►  September (20)
    • ►  August (28)
    • ►  July (23)
    • ▼  June (21)
      • Yay! iTunes Store for Asia
      • Your next browser should be Opera 12
      • Bumblebee Project for Nvidia Optimus: Ubuntu 12.04...
      • Linux on Film: Supernatural Season 7 Episode 20 (w...
      • Getting started with DocBook using XML Copy Editor
      • Microsoft Windows 8 Tablets: iTunes, skinnable Met...
      • Where are the Skype Conversation Ads?
      • Using LyX to Publish or Organize your Journal/Diary
      • Congratulations Linus!
      • Editing EPUB using Sigil and Calibre in Linux Part 2
      • Taiwan Computex Booth Babes vs. WWDC's Apple Macbo...
      • Britannica and Bing Beats
      • Technical Writing with an iMac PowerPC G5 with 512...
      • Technical Writing with an iMac PowerPC G5 with 512...
      • openSUSE 12.1 in China: Updating and Mirrors
      • Bara-BING 2012: A Quick Bing Search Review
      • Fedora 17 LXDE Review: Just the Facts Ma'm
      • More than a Decade of CorelDraw: Adobe's Underrate...
      • Apple Store, Shanghai - Testament to Apple's Popul...
      • Shanghai Online Shopping and the Receptionist
      • Getting Broadband in Shanghai (China Telecom) Part 2
    • ►  May (15)
    • ►  April (26)
    • ►  March (9)
    • ►  February (11)
    • ►  January (30)
  • ►  2011 (10)
    • ►  December (10)
Powered by Blogger.

About Me

Unknown
View my complete profile