The formatting of comments can also be defined in the CSS (see [[#Pseudo_Elements|Pseudo Elements]]).

+

The formatting of comments can also be defined in the CSS (see [[#VEX_specific_elements|VEX specific elements]]).

+

+

=== Add Processing Instructions ===

+

To insert a processing instruction choose '''''Document | Add | Processing Instruction'''''. A dialog appears to set the ''target'' of the new processing instruction. To edit the ''target'' later, place the caret inside the processing instruction and use the right-click menu '''''Set Target'''''.

+

+

CSS may be used to change the display format of processing instructions (see [[#VEX_specific_elements|VEX specific elements]]).

Vex User Guide

Overview

What is Vex?

Vex is a Visual Editor for XML that hides the raw XML tags from the user, providing instead a word processor like interface. Vex uses standard DTD files to define document types and CSS stylesheets to define document layout. Vex contains definitions for DocBook, DITA and XHTML. To edit other XML formats only a DTD (or XML schema) and a CSS are needed.

Who Uses Vex?

Installation

After installing one of the Eclipse Indigo or later packages, the easiest way to install Vex is via the Eclipse Marketplace by performing the following steps:

Select the Help - Eclipse Marketplace... menu item

Enter "Vex" in the Find field of the Search tab and select [Go]

Select [Install]

Follow prompts

The Vex installer adds the following items to your Eclipse installation.

Visual XML Editor

XML Authoring Perspective

XML Authoring New Document Wizard

XML Authoring New Visual XML Plug-in Project Wizard

The Vex installer also makes the Visual XML editor the default editor for xml files. If you would like to change this preference see the General - Editors - File Associations section of the Eclipse Preferences tool.

Document Creation

After installation, you are ready to create and edit an XML document using the Vex tools. You are not required to use the Vex tools to create the initial XML document but the Vex tools may help you get started. After creating a project to contain your XML document, perform the following step:

Select the File - New - Other menu item

Expand the XML Authoring section

Select Document and then select the [Next] button

Select the Document Type and Root Element and then select the [Next] button

Select location for the file and enter the file name (Note: include the .xml or .xhtml at the end of the file name.)

Select finish

Vex supports the following Document Types out of the box.

DITA Composite

DITA Concept

DITA Map

DITA Reference

DITA Task

DITA Topic

DocBook 4.5

DocBook 5.0 (either as DTD or XML schema)

Eclipse Project Plan

XHTML 1.0 Strict

After creating the document you are ready to add elements and content.

Open an existing document

When opening an existing document, VEX automatically determines the Document Type from the DOCTYPE declaration. If the document does not contain such a declaration, or when the Document Type is unknown to VEX, the Type has to be selected manually.

When 'Always use this document type...' is checked, VEX adds the according DOCTYPE declaration and immediately saves the document.

Document Navigation

You navigate between and within document elements using the mouse and the arrow keys on your keyboard. As you navigate the document, the Eclipse status bar displays your current location within the document and the cursor orientation gives you clue as to what you can do at the current location.

A vertical cursor indicates that you can type content into the element while a horizontal cursor indicates that Vex is expecting you to insert new element.

Navigation Tip: Sometimes it is difficult or impossible to select the correct location to insert a new element using the mouse. However, you should be able to get close with the mouse and then use the arrow keys to find the desired location.

Document Editing

Vex provides several commands to edit a XML document.

Editing Tip: Currently, Vex only displays the rendered view of the XML document, so you may want to also open the document using the Eclipse XML Editor. Having the document open in both editors allows you to move between the rendered XML in Vex and the source XML in the XML Editor.

Copy and Paste

Undo/Redo

Add Element

To insert a new element at the current cursor position or - in the case if something is selected - to surround the selected text or fragment with a new element:

Choose Document | Add | Element... (or hit Ctrl+Space)

In the content assist which pops up choose the element to add by one of the following possibilities:

Use Up and Down keys to select element and hit Return

Click on the element to add

To filter the list of elements type the name or a part of the name and hit Return to add the topmost element

Tip: To place the cursor at the proper position (e.g. a new chapter between two existing chapters in DocBook) see the path which is shown in the status bar.

Add Comment

Vex allows to insert and edit XML comments: simply choose Document | Add | Comment (or hit Ctrl+7) to insert a new comment at the current cursor position. Vex renders <!-- and --> as start and end marker for the comment. Everything between those markers is the comment text.

Add Processing Instructions

To insert a processing instruction choose Document | Add | Processing Instruction. A dialog appears to set the target of the new processing instruction. To edit the target later, place the caret inside the processing instruction and use the right-click menu Set Target.

Duplicate Selection

This command duplicates the currently selected elements and inserts them at the beginning of the current selection. If there is nothing selected, 'Duplicate Selection' duplicates the element that surrounds the current cursor position.

The document's root element can, of course, not be duplicated.

Convert Element

This command allows you to change the surrounding element of the current selection. A popup dialog shows a list of all elements that could replace the element. An element A can be replaced by another element B, if B can contain all the content of A and B is allowed at A's position in the document structure. If you select one of the list items, the popup dialog is closed and the element, which surrounds the current selection is replaced by the selected element.

Remove Tag

This command removes the element that surrounds the current selection:

<emph>The element's content<emph/>

will result in

The element's content

The main purpose of this command is to remove inline elements from text. If you use 'Remove Tag' to remove structural elements (e.g. <para> or <section>), the content of the element might also be removed. The current implementation does not handle this case properly. This might change in the future.

The Remove Tag command can also be used to remove comment tags from a comment to "uncomment" text.

Find/Replace

The option Scope is inoperable.

Visual XML Plug-in Project: Configure your own XML format

A Visual XML Plug-in Project contains information about a custom document type accompanied with (at least one) style definition. This is one way to make a custom document type usable in the Visual Editor for XML (Vex).

The Visual XML Plug-in Project consist of a file named vex-plugin.xml, which contains the configuration, plus all files needed for the document type definition (DTD) or XML Schema (XSD) and style (CSS).

The following steps describe how to create such a Visual XML Plug-in Project:

Choose File | New | Project...

Choose XML Authoring | Visual XML Plug-in Project

Add the DTD/XSD and CSS file into the project

For a *.dtd file:

Open the properties dialog for the main *.dtd file: Right-click on the *.dtd file and choose 'Properties

Choose Visual XML Document Type

Enter all information about the document type and select the allowed root elements

For a *.xsd file:

Open the vex-plugin.xml file with a text editor: Right-click on the vex-plugin.xml file and choose Open With... | Text Editor

VEX specific properties

_vex-outline-contentThis property decides which content is shown in the outline view.The value is either the name of a child element, an attribute or 'none'. As default the elements text content is used in the outline display.This property can hold several element names as a "fallback" system. 'none' can be used to prevent the default usage of the element's text content.Examples:

chapter {_vex-outline-content: titleabbrev, title; }

imagedata {_vex-outline-content: attr(fileref); }

VEX specific elements

vex|commentThis element allows formatting of comments.

vex|processing-instructionThis element allows formatting of processing instructions.The attribute target is available to be used as content.Example: