Creating a New Document with a Template

For certain types of XML documents there are predefined document templates, e.g for Docbook and DITA documents. To create such documents, you merely choose the name of the appropriate template, and the appropriate XML metadata, such as DTD, schema and stylesheet, will be applied automatically.

Note:

See Document Template Development for instructions on how to create your own custom document templates for your XML documents.

  1. Call up the New Document Dialog.

    To call up the New Document Dialog, choose Document > New Document , or click the New Document button on the toolbar, or press Ctrl-N.

    Figure 1. New Document Dialog.



  2. Select a document template.

    In the New Document Dialog, select a Category and a Template.

    E.g. choose: Docbook V4.5 - Book to create a Docbook with the book root element.

    Tip:

    You can click the Details... button to see the values provided by the selected template and change them if needed:

    Figure 2. Metadata details of the selected Document Template in the New Document Dialog.



    1. PUBID/SYSID

      In the PUBID and SYSID fields, see the paths to the corresponding DTD prescribed by the selected template.

      To assign the path to some DTD other than that prescribed by the selected template, modify the paths in the PUBID and SYSID fields.

    2. Schema

      In the Schema field, see the path to the corresponding schema prescribed by the selected template.

      To assign the path to some schema other than that prescribed by the selected template, modify the path in the Schema field (or click the Browse button next to this field) . You can specify an absolute path as well as a relative path to your schema. A relative path may be specified with the $SERNA_DATA_DIR variable that points to the directory where Serna is installed. For example: $SERNA_DATA_DIR/plugins/MyCorporation/Memo.xsd.

    3. Stylesheet

      In the Stylesheet field, see the path to the corresponding stylesheet prescribed by the selected template.

      To assign the path to some stylesheet other than that prescribed by the selected template, modify the path in the Stylesheet field (or click the Browse button next to this field). You can specify an absolute path as well as a relative path to your stylesheet. A relative path may be specified with the $SERNA_DATA_DIR variable that points to the directory where Serna is installed. For example: $SERNA_DATA_DIR/plugins/MyCorporation/Memo.xsl.

    4. Encoding

      In the Encoding field, see the encoding prescribed by the selected template.

      To assign an encoding other than that prescribed by the selected template, select it from the Encoding drop-down list.

  3. Specify the filename and location for the new document.

    In the File Name field, enter the filename. You can use the Browse button to specify the file location.

  4. Click OK.

    If the selected template contains a particular root element, the new document will be created with this root element.

    Otherwise, you will have to specify the root element in the Enter Root Element Dialog.

Related concepts
Specifying the Root Element for a New Document
Related tasks
Creating a New Document without a Template
Related information
New Document Dialog
Enter Root Element Dialog