文書型 > Installing a Document Type > Changing a DocBook Document's Start Element
  
Changing a DocBook Document's Start Element
The DocBook DTD is designed to accommodate documents that start at different levels of the markup hierarchy. The DocBook template starts at the book level. However, you might want a document to start at the set level, the book level, or the chapter level.
To change a DocBook document's start element:
1. If the Arbortext Editor command line is not enabled, choose Tools > Preferences, and select the Command Line option on the Window tab.
2. Click Save.
3. Choose File > New, and select the DocBook document type. This creates a document that has Book as its top-level element.
4. Choose File > Save to save this document.
5. Type edit -current -untagged at the command line. The document will display in plain-text form.
6. Edit the public identifier to reflect the new start element. For example, if you want the document to start at the chapter element, you would change the public identifier to the following:
<!DOCTYPE CHAPTER PUBLIC "-//OASIS//DTD DocBook V4.0//EN">
7. Remove any tags and information that appear before the new start element.
For example, consider the following DocBook document, which is based on the standard template:
<!DOCTYPE BOOK PUBLIC "-//OASIS//DTD DocBook V4.0//EN">
<!--Arbortext, Inc., 1988-2002, v.4002-->
<book>
<title></title>
<bookinfo>
<corpauthor></corpauthor>
</bookinfo>
<chapter>
<title></title>
<para></para>
</chapter>
</book>
If you want to reconfigure this document type to start with the chapter element, you would have to remove the book, title, bookinfo, and corpauthor start and end tags:
<!DOCTYPE CHAPTER PUBLIC "-//OASIS//DTD DocBook V4.0//EN">
<!--Arbortext, Inc., 1988-2002, v.4002-->
<chapter>
<title></title>
<para></para>
</chapter>
8. Save the document.
9. Type edit -current at the command line or choose File > Revert to Saved. You can now create a document based on this document type.