<oXygen/> XML Editor User Guide |
As with most editing applications, <oXygen/> lets you open existing documents, save your changes and close them as required.
<oXygen/> supports a large number of document types. Use the following procedure to create documents.
Procedure 4.1. Creating new documents
Select Ctrl+N) or press the 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.
-> (Select a document type, then click If XML was selected the "Create an XML Document" dialog is displayed otherwise a new document is opened in the Editor Panel.
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
. If the prolog is required complete the fields as the following.Complete the dialog as follows:
When checked enables selection between DTD, XML Schema, Relax NG schema or NRL schema.
Specifies the location of an XML Schema Document (XSD).
Specifies the document namespace.
Populated from the elements defined in the specified XSD, enables selection of the element to be used as document root.
Shows a small definition for the currently selected element.
Complete the dialog as follows:
When checked enables selection between DTD, XML Schema, Relax NG schema or NRL schema.
Specifies the location of a Document Type Definition (DTD).
Specifies the PUBLIC identifier declared in the Prolog.
Populated from the elements defined in the specified DTD, enables selection of the element to be used as document root.
Shows a small definition for the currently selected element.
Complete the dialog as follows:
When checked enables selection between DTD, XML Schema, Relax NG schema or NRL schema.
Specifies the location of a Relax NG schema in XML or compact syntax (RNG/RNC).
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.
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.
Specifies the root element namespace.
Populated from the elements defined in the specified RNG or RNC document, enables selection of the element to be used as document root.
Complete the dialog as follows:
When checked enables selection between DTD, XML Schema, Relax NG schema or NRL schema.
Specifies the location of a NRL schema (NRL).
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:
Open a template using the following options:
Populates the Templates list to show templates supplied with the <oXygen/> installation package.
Populates the Templates list to show previous saved personal templates.
Enables definition of a URL location containing Templates.
Displays the available templates for Standard, From File and From URL options.
Procedure 4.2. Creating Documents based on Standard Templates
Select
-> or press the 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.Select the Standard option from the Load Templates Group. The Templates list displays standard <oXygen/> templates.
Scroll the Templates list and select the required Template Type.
Click
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
Select
-> or press the toolbar button. The Templates dialog is displayed.Select the User defined option from the Load Templates Group. The Templates list displays person templates.
Scroll the Templates list and select the required Template Type.
Click
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
Select
-> or press the toolbar button. The Templates dialog is displayed.Select the From URL option from the Load Templates Group. The From URL field is enabled.
Enter the URL location of the templates, then click
. The list of templates is retrieved from the URL and displayed in the Templates list.Scroll the Templates list and select the required Template Type.
Click
A new document is opened that already contains structure and content provided in the template starting point.The edited document can be saved with one of the actions:
Ctrl+S) to save the current document. If the document does not have a file, displays the Save As dialog.
-> (-> : Displays the Save As dialog, used to name and save an open document to a file; or save an existing file with a new name.
Save As dialog.
-> : Saves all open documents. If any document does not have a file, displays theDocuments can be opened using one of the actions:
Ctrl+O) to display the Open dialog used to discover, select and open one or more files.
-> (Open URL dialog, used to open a document using FTP/WebDAV.
-> or press the toolbar button to display the-> : Loads the last saved file content. All unsaved modifications are lost.
-> : Displays a list of recently opened document files. Select a file to open.
-> : Opens the selected file from the Project panel.
In addition <oXygen/> supports direct opening of files from the command prompt. Use the following command syntax:
oxygen.bat FileToOpen.xml
sh ./oxygen.sh FileToOpen.xml
sh ./oxygenMac.sh FileToOpen.xml
Also when the Tree Editor perspective is activated the current document in the Editor perspective will be opened and displayed as a tree of XML elements.
<oXygen/> supports editing remote files, using the FTP and WebDAV protocols. The remote opened files can be edited exactly as the local ones. They can be added to the project, and can be subject to XSL and FO transformations.
![]() | Note |
---|---|
The WebDAV access is implemented using the Slide package of the Apache Software Foundation. The FTP part is using passive access to the FTP servers. Make sure the server you are trying to connect to is supporting passive connections. The FTP/WebDAV capabilities have been extensively tested with various servers running on Windows (IIS), Mac OS X and Linux (Apache). |
![]() | Note |
---|---|
If you have set a proxy server to be used by <oXygen/>, make sure it supports the WebDAV protocol. If it does not, make sure you uncheck the "Use proxy server" from the Options/Preferences/Proxy Configuration pane, otherwise you will not be able to connect to a WebDAV server. |
To open the remote files, choose from the main menu
-> The displayed dialog is composed of three parts.The first one is an editable combo box, in which it can be specified directly the URL to be opened or saved.
![]() | URLs that can be directly opened |
---|---|
You can type in here an URL like http://some.site/test.xml, in case the file is accessible through normal HTTP protocol, or ftp://anonymous@some.site/home/test.xml if the file is accessible through anonymous FTP. |
This combo box is also displaying the current selection when the user changes selection by browsing the tree of folders and files on the server.
The second part is controlling the access credentials. If you want to browse for a file on a server, you have to specify the user and password. This information is bound to the selected URL displayed in the "File URL" combo box, and used further in opening/saving the file. If the check box "Save" is selected, then the user and password are saved between editing sessions. The password is kept encrypted into the options file.
![]() | Note |
---|---|
Your password is well protected. In the case the options file is moved to another installation, on other machine, the password will become unreadable, since the encryption is user and machine dependent. This is also true if you add URLs having user and password to your project. |
The third part contains the server combo and the "Autoconnect" check box. Into the server combo it may be specified the protocol (HTTP, HTTPS or FTP), the name or IP of the server and, in case of WebDAV, the path to the WebDAV directory.
![]() | Server URLs | ||
---|---|---|---|
When accessing a FTP server, you need to specify only the protocol and the host, like: ftp://server.com, ftp://ftp.apache.org, or if using a nonstandard port: ftp://server.com:7800/ etc. When accessing a WebDAV server, along with the protocol and the host, it must be specified also the directory of the WebDAV repository.
Ex: https://www.some-webdav-server.com:443/webdav-repository/, http://devel:9090/webdav/ |
By pressing the "Browse" button the directory listing will be shown in the component bellow. When "Autoconnect" is selected then at every time the dialog is shown, the browse action will be performed.
The last part consists of a tree view of the documents stored on the server. You can browse the directories, and make multiple selections. Additionally, you may use the "Rename", "Delete", and "New Folder" to manage the file repository.
If you want to access a WebDAV repository across an insecure network <oXygen/> allows you to load and save the documents over the HTTPS protocol (if the server understands this protocol) so that any data exchange with the WebDAV server is encrypted.
When a WebDAV repository is first accessed over HTTPS the server hosting the repository will present a security certificate to <oXygen/> as part of the HTTPS protocol, without any user intervention. <oXygen/> will use this certificate to decrypt any data stream received from the server. For the authentication to succeed you should make sure the security certificate of the server hosting the repository can be read by <oXygen/>. This means that <oXygen/> can find the certificate in the key store of the Java Runtime Environment in which it runs. You know the server certificate is not in the JRE's key store if you get the error "No trusted certificate found" when trying to access the WebDAV repository:
You can add a certificate to the key store by exporting it to a local file using any HTTPS-capable Web browser (for example Internet Explorer) and then importing this file into the JRE using the keytool executable bundled with the JRE. The steps are the following using Internet Explorer (if you use other browser the procedure is similar):
Procedure 4.5. Import a HTTPS server certificate
Export the certificate into a local file
Point your HTTPS-aware Web browser to the repository URL. If this is your first visit to the repository it will be displayed a security alert stating that the security certificate presented by the server is not trusted.
Press the button "View Certificate".
Select the "Details" tab.
Press the button "Copy to file ...". This will start the Certificate Export Wizard on Windows
Follow the indications of the wizard to save the certificate to a local file, for example server.cer .
Import the local file into the JRE running <oXygen/>
Open a text-mode console.
Go to the lib/security subdirectory of your JRE directory, that is of the directory where it is installed the JRE running <oXygen/>, for example on Windows C:\Program Files\Java\j2re1.4.2\lib\security
Run the following command:..\..\bin\keytool.exe -import -trustcacerts -file local-file.cer -keystore cacerts where local-file.cer is the file containing the server certificate, created during the previous step. Keytool requires a password before adding the certificate to the JRE keystore. The default password is "changeit". If somebody changed the default password then he is the only one who can perform the import. As a workaround you can delete the cacerts file, re-type the command and enter as password any combination of at least 6 characters. This will set the password for future operations with the key store.
Restart <oXygen/>
To close documents use one of the following methods:
Ctrl+W) : Closes only the selected tab. All other tab instances remain.
-> (-> : Closes all opened documents. If a document is modified or has no file, a prompt to save, not to save, or cancel the save operation is displayed.
- accessed by right-clicking on an editor tab: Closes the selected editor.
- accessed by right-clicking on an editor tab: Closes the other files except the selected tab.
- accessed by right-clicking on an editor tab: Closes all open editors within the panel.
<oXygen/> enables user defined templates to be created. Templates are created by adding an existing document to the Template library.
Procedure 4.6. Creating New Templates
Open the document that will be used to create the Template.
Modify the structure and content as required.
New from templates option.
-> or press the toolbar button to display the Add Templates dialog used to define the name by which the template will be recognized in theEnter the name by which the template will be known. Click
the document is added to the list of Personal Templates.Test the template using the From File option.
<oXygen/> stores Personal Templates in an XML file called
.com.oxygenxml/templates.xml
, located in the Home
folder of the <oXygen/> user. By copying this file to a Web Server folder
and making it accessible via HTTP, other <oXygen/> users
can use the From URL option to access the templates.
You can quickly access informations about the current edited document like the character encoding, full path on the filesystem, schema used for content completion and document validation, associated transformation scenario, if bidirectional text (left to right and right to left) is enabled, indent size by going to
->