Opening and closing documents

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

Creating new documents

<oXygen/> plugin wizards

The New wizard only creates a skeleton document containing the document prolog, a root element and possibly other child elements depending on the options specific for each schema type.

Use the following procedure to create documents.

The <oXygen/> plugin installs a series of Eclipse wizards for easy creation of new documents. Using these wizards you let <oXygen/> fill in details like the system ID or schema location of a new XML document, the minimal markup of a DocBook article or the namespace declarations of a Relax NG schema.

Procedure 4.1. Creating new documents

  1. Select FileNew-> Other (Ctrl+N) or press the New toolbar button. is displayed which contains the supported Document Types: XML, CSS File.

  2. Select a document type, then click Next. For example if XML was selected the "Create an XML Document" wizard is started.

  3. Type a name for the new document and press Next.

  4. 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), NRL (Namespace Routing Language) or NVDL (Namespace-based Validation Dispatching 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.1. The Create an XML Document Dialog - XML Schema Tab

    The Create an XML Document Dialog - XML Schema Tab

    Complete the dialog as follows:

    URL

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

    You can also specify an URI if it is solved by the <oXygen/> catalog.

    Example 4.1. DITA XSD URI

    urn:oasis:names:tc:dita:xsd:topic.xsd:1.1


    Document Root

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

    Namespace

    Specifies the document namespace.

    Prefix

    Specifies the prefix for the namespace of the document root.

    Description

    Shows a small definition for the currently selected element.

    Add optional content

    If it is selected the elements and attributes that are defined in the XML Schema as optional are generated in the skeleton XML document created in a new editor panel when the OK button is pressed.

    Add first Choice particle

    If it is selected the first element of an xs:choice schema element is generated in the skeleton XML document created in a new editor panel when the OK button is pressed.

    Figure 4.2. The Create an XML Document - DTD Tab

    The Create an XML Document - DTD Tab

    Complete the dialog as follows:

    System ID

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

    Document Root

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

    Public ID

    Specifies the PUBLIC identifier declared in the Prolog.

    Figure 4.3. The Create an XML Document - Relax NG Tab

    The Create an XML Document - Relax NG Tab

    Complete the dialog as follows:

    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.

    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.

    Namespace

    Specifies the document namespace.

    Prefix

    Specifies the prefix for the namespace of the document root.

    Description

    Shows a small definition for the currently selected element.

    Figure 4.4. The Create an XML Document - NRL Tab

    The Create an XML Document - NRL Tab

    Complete the dialog as follows:

    URL

    Specifies the location of a NRL schema (NRL).

    Figure 4.5. The Create an XML Document - NVDL Tab

    The Create an XML Document - NVDL Tab

    Complete the dialog as follows:

    URL

    Specifies the location of a Namespace-based Validation Dispatching Language schema (NVDL).

    Document Root

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

    Namespace

    Specifies the document namespace.

    Prefix

    Specifies the prefix for the namespace of the document root.

    Description

    Shows a small definition for the currently selected element.

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.

You can also use editor variables in the template files' content and they will be expanded when the files are opened.

The New from Templates wizard 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:

The list of templates presented in the dialog includes:

Document Types templates

Templates supplied with the defined document types.

User defined templates

The user can add template files in the templates folder of the <oXygen/> install directory. Also in the option page can be specified a custom templates folder to be scanned.

Procedure 4.2. Creating Documents based on Templates

  1. Select FileNewNew from Templates The New from templates dialog is displayed.

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

  3. Type a name for the new document and press Next.

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