Opening and closing documents

As with most editing applications, <oXygen/> lets you open existing documents, save your changes and close them as required.

 Creating new documents

 The New dialog

<oXygen/> supports a large number of document types. Use the following procedure to create documents.

 

Procedure 4.1. Creating new documents

  1. Select File->New (Ctrl+N) or press the New toolbar button. The New dialog is displayed which contains the supported Document Types: XML, XSL, XML Schema, Document Type Definition, Relax NG Schema, XQuery, Web Services Definition Language, Schematron Schema, CSS File , Text File, Java File, JavaScript File, C File, C++ File, Batch File, Shell File, Properties File, SQL File, PHP File and PERL File.

     

    Figure 4.4. The New dialog

    The New dialog
  2. Select a document type, then click OK. If XML was selected the "Create an XML Document" dialog is displayed otherwise a new document is opened in the Editor Panel.

  3. The Create an XML Document dialog enables definition of a XML Document Prolog using the system identifier of a XML Schema, DTD, Relax NG (full or compact syntax) schema or NRL (Namespace Routing Language) schema. As not all XML documents are required to have a Prolog, you may choose to skip this step by clicking OK. If the prolog is required complete the fields as the following.

     

    Figure 4.5. The Create an XML Document Dialog - XML Schema Tab

    The Create an XML Document Dialog - XML Schema Tab

    Complete the dialog as follows:

    Use a DTD, XML Schema, Relax NG or NRL schema

    When checked enables selection between DTD, XML Schema, Relax NG schema or NRL schema.

    URL

    Specifies the location of an XML Schema Document (XSD).

    Namespace

    Specifies the document namespace.

    Prefix

    Specifies the prefix for the namespace of the document root.

    Document Root

    Populated from the elements defined in the specified XSD, enables selection of the element to be used as document root.

    Description

    Shows a small definition for the currently selected element.

     

    Figure 4.6. The Create an XML Document Dialog - DTD Tab

    The Create an XML Document Dialog - DTD Tab

    Complete the dialog as follows:

    Use a DTD, XML Schema, Relax NG or NRL schema

    When checked enables selection between DTD, XML Schema, Relax NG schema or NRL schema.

    System ID

    Specifies the location of a Document Type Definition (DTD).

    Public ID

    Specifies the PUBLIC identifier declared in the Prolog.

    Document Root

    Populated from the elements defined in the specified DTD, enables selection of the element to be used as document root.

    Description

    Shows a small definition for the currently selected element.

     

    Figure 4.7. The Create an XML Document Dialog - Relax NG Tab

    The Create an XML Document Dialog - Relax NG Tab

    Complete the dialog as follows:

    Use a DTD, XML Schema, Relax NG or NRL schema

    When checked enables selection between DTD, XML Schema, Relax NG schema or NRL schema.

    URL

    Specifies the location of a Relax NG schema in XML or compact syntax (RNG/RNC).

    XML syntax

    When checked the specified URL refers to a Relax NG schema in XML syntax. It will be checked automatically if the user selects a document with the .rng extension.

    Compact syntax

    When checked the specified URL refers to a Relax NG schema in compact syntax. It will be checked automatically if the user selects a document with the .rnc extension.

    Namespace

    Specifies the root element namespace.

    Document Root

    Populated from the elements defined in the specified RNG or RNC document, enables selection of the element to be used as document root.

     

    Figure 4.8. The Create an XML Document Dialog - NRL Tab

    The Create an XML Document Dialog - NRL Tab

    Complete the dialog as follows:

    Use a DTD, XML Schema, Relax NG or NRL schema

    When checked enables selection between DTD, XML Schema, Relax NG schema or NRL schema.

    URL

    Specifies the location of a NRL schema (NRL).

 Creating Documents based on Templates

Templates are documents containing a predefined structure. They provide starting points on which one can rapidly build new documents that repeat the same basic characteristics. <oXygen/> installs a rich set of templates for a number of XML applications. You may also create your own templates and share them with other users.

The Templates dialog enables you to select predefined templates or templates that have already been created in previous sessions or by other users. Open a template using the following options:

 

Figure 4.9. The Templates dialog

The Templates dialog

Open a template using the following options:

Standard

Populates the Templates list to show templates supplied with the <oXygen/> installation package.

User defined

Populates the Templates list to show previous saved personal templates.

From URL

Enables definition of a URL location containing Templates.

Templates List

Displays the available templates for Standard, From File and From URL options.

 

Procedure 4.2. Creating Documents based on Standard Templates

  1. Select File-> New from Templates or press the New from templates toolbar button. The Templates dialog is displayed and is used to discover, select and open a new document based on an existing template document. Template documents act as starting points that have predefined properties such as file type, prolog, root element, containers and even existing content.

     

    Figure 4.10. The Templates dialog

    The Templates dialog
  2. Select the Standard option from the Load Templates Group. The Templates list displays standard <oXygen/> templates.

  3. Scroll the Templates list and select the required Template Type.

  4. Click OK. A new document is opened that already contains structure and content provided in the template starting point.

 

Procedure 4.3. Creating Documents based on Personal Template Files

  1. Select File-> New from Templates or press the New from templates toolbar button. The Templates dialog is displayed.

     

    Figure 4.11. The Templates dialog

    The Templates dialog
  2. Select the User defined option from the Load Templates Group. The Templates list displays person templates.

  3. Scroll the Templates list and select the required Template Type.

  4. Click OK. A new document is opened that already contains structure and content provided in the template starting point.

 

Procedure 4.4. Creating Documents based on URL Template Files

  1. Select File-> New from Templates or press the New from templates toolbar button. The Templates dialog is displayed.

     

    Figure 4.12. The Templates dialog

    The Templates dialog
  2. Select the From URL option from the Load Templates Group. The From URL field is enabled.

  3. Enter the URL location of the templates, then click Load. The list of templates is retrieved from the URL and displayed in the Templates list.

  4. Scroll the Templates list and select the required Template Type.

  5. Click OK. A new document is opened that already contains structure and content provided in the template starting point.