User manual for XML Assistant v1.1
Content:1. Tutorial as quick introduction
1.1 Open files
1.2 Edit and use rules
1.3 Templates
2. Edit XML
2.1 Main features
2.2 Manage namespaces
3. Editing rules
3.1 Open example and adjust tabs
3.2 Organize rules
3.3 What rules are
3.4 Display options
4. More hints
4.1 Also show elements with content
4.2 "Jump" to sub element + Multiple selection
4.3 Rearrange elements in edit pane
5. Start now
1. Tutorial as quick introduction
This tutorial teaches you the main functions of the XML Assistant using concrete examples.
Files are opened using the menu item File->Open or the icon in the toolbar.
For this tutorial we open the example file using the predefined menu item Help->Example "Internet pages".
The following figure shows the file opened in the XML Assistant. The application window is divided into: 1) View of the XML file as tree of nodes 2) Attributes and elements of the tree node selected 3) View of the XML Code.
View rules define how the data of a XML file is shown. For different types of XML files different rule sets can be created.
The rule set "Internet pages" is already selected in the list of rule sets. The rules defined there are applied to the file, they define icons and text of the tree (left) and the input fields for the element selected (right).
Lets modify the rules of the rule set to better understand how it works.
Please select 'Edit rules' from the toolbar:
The tab "rules.xml" is opened:
For a clearer view we minimize the XML code view and position the tab 'Edit rules' at the bottom.
This is done by clicking on the tab title and dragging it to the bottom forth of the main window. The mouse cursor is changing during the drag operation.
Now we edit the view rules, we open the rule set "Internet pages" and the rule "Web Page". When selection "Condition: Page" or "Conditions meet" we can, for example, see that the text "Page: http://www.myspace.com (05)" may be shown for a tree node that represents the element "Page". Multiple "Page" elements are shown in the tree.
Now change the input for "Node text in tree" to '$name: [Title] ([@id])'. The changes are directly applied while you are typing. The text encoded in square brackets is not simple text but expresses a XPath-Expression to be executed on this element. In this example the title is shown instead of the URL.
As you can see in the existing rule sets, many more configuration possibilies are available. Please take a few seconds to try them out.
Templates are used to add frequently used code passages quickly. This may prevent the need for frequent copy/paste operations.
For demonstration we again use the file "Internet pages".
Doing a right click on the root node will open the context menu. In the sub menu "New" you can already see a template, that has been defined to be listed here. For creation of a new template we select "Responsible" and choose "As new template" from its context menu.
A template is simply an own XML file whose content is made available over the context menu. Templates are edited and saved like ordinary XML files. They are saved in the subdirectory 'templates' of the installation.
In this example we remove all content of the template nodes, this is done by selecting the root node and the function Edit->Remove contents.
The template must also be made available to the nodes that use the template. For this, open the rule set "Internet pages" and the rule "Web page", the sub item "Templates in context menu" of "Conditions match" defines, which templates are to be listed in the context menu for nodes matching this rule. We add the new template.
The template will be shown in the context menu list now.
2. Edit XML
Describes the main features for editing XML in XML Assistant.
The most important edit features are accessed using the context menu (right mouse click) of the XML tree nodes or the menu Edit in the main menu:
The main features are:
- Add attribute: Create a new attribute
- Add element: Create new element
- Add node: Creates a new element and contained in it another element. This will show the enclosing element in the XML tree on the left. You can also achieve this by adding an element and another element to it.
- Create duplicates: Creates a duplicate of the node selected and inserts it as a neighbour.
Namespaces are not edited directly (by adding xmlns attributes) but using the menu item Edit->Manage namespaces. Please first select the node to edit namespaces for.
The next figure shows the list of namespaces for:
- Default Namespace: [empty]
- Namespace 'assistantNs' with URI 'http://XML-Assistant'
In XML it will look like this:
Using the dialog window you can add, edit and delete namespaces.
3. Editing rules
The comfort of editing XML files considerable depends on the rules being used. Using an example file this chapter will show, which view rules the XML Assistant provides.
3.1 Open example and adjust tabs
Preparation of the example
First we open the needed tabs, to do this, choose Help>Example "Internet pages" from the main menu.
Now choose 'Edit rules'.
The tab for editing the rule sets is opened. As shown below it is more comfortable to move the tab for editing rules to the bottom of the window. For this, drag the tab title with left mouse button hold down to the bottom of the main window.
To finish the preparation please minimize the XML code. We will not need it.
Rules and rule sets
Rules are organized in rule sets. For the example file there already exists the rule set "Internet pages". Every rule set may contain multiple rules.
Conditions and display options of rules
Rules do contain one or more conditions (in most cases cases one condition is sufficient) and many display options. If all of the conditions (1) are met for a node, the display options (2) are applied.
In this example the condition "Name is... InternetPage" is sufficient. It means that if an elements in the tree has this name, the display options are applied. The other types of conditions are discribed on the page for editing a condition.
If all conditions match, the display options under "Conditions match" (1) are applied. The options affect the tree (2: left) and the input panel (3: right).
Overview over the display options
The display options are separated into different categories. These categories are:
- Show title: Here you can customize the title and sub title shown in the input panel (right)
- Display options: Sets main display options, e.g. whether element/attribute names are editable
- Operations allowed: To preserve simple parts of the data for unintended modifications, several edit operations can be activated/deactivated here
- Show as combobox: Using this feature you can show a Combobox instead of a text field for the text content of an element/attribute. This is useful for recurring values
- Show as checkboxes (yes/no): For elements/attributes that do only have two values (e.g. true/false) you can show a checkbox
- Show as checkbox list: Allows activation/deactivation of multiple values. The values are separated by a delimiter
- Help texts for elements/attributes: Shows additional help texts for single fields. Using this you can, for example, add edit instructions
Please take some time to make you familiar with the display options.
4. More hints
4.1 Also show elements with content
The XML Assistant hides as much as possible of XML files. Doing this it enables you to concentrate on the contents. But in some cases you would like to also show elements with attributes or sub elements in the edit panel (right). This may be needed to e.g. change the order of the elements. To do this, please activate the option "Also show elements with content".
This will result in also these elements being listed.
4.2 "Jump" to sub element + Multiple selection
By pressing the CTRL key and moving the cursor over a field that represents an element with children the mouse cursor changes. Doing a right click will jump to this element.
By clicking with the left mouse button when CTRL is down, the entry clicked is added to the selection.
4.3 Rearrange elements in edit pane
Click on a text field and hold down the CTRL key. By moving the mouse wheel the element of this field is moved up or down.
5. Start now
This documentation covers the major functions of XML Assistant, but not all.
We hope you enjoy using our software.