User Manual For XML Assistant v1.2Content:
1. Tutorial as Quick Introduction
1.1 Open Files
1.2 Edit and Use Rules
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 Text Fields and Tree Nodes
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) Namespaces, attributes and elements of the tree node selected 3) View of the XML Code.
Display 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 "WebPages" 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 Display Rules' from the toolbar:
The tab "Display Rules" is opened:
For a clearer view we minimize the XML code view and position the tab 'Display Rules' at the bottom.
As the next step we move the tab 'Display Rules' to the bottom of the main window. 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.
The tab is rearranged:
Now we edit the display rules, we open the rule set "WebPages" and the rule "Web Page". On selection of "Condition: Page" or "Conditions Match" 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.
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 user directory.
In this example we remove all content of the template nodes, this is done by selecting the root node and the context menu item Edit->Remove Contents.
The template must also be made available to the nodes that use the template. For this, open the rule set "WebPages" 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:
- Duplicate: Creates a duplicate of the node selected and inserts it as a neighbour.
- 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.
- Add Namespace: Create a namespaces
- Remove Contents: Clears the content of nodes selected
Namespaces are managed similarly to attributes and content. To add a namespaces, use the menu entry 'Add Namespace' (also available in main menu 'Edit'):
Add prefix and URI in the input dialog, e.g.:
After confirmation with 'Ok' the new namespace is added:
Using the context menu of the namespace shown, you can delete and edit the namespace:
For editing in the right area you can use the following shortcuts on your keyboard:
- ARROW-UP, ARROW-DOWN: Switch to the next/previous attribute or content
- CTRL+ARROW-UP, CTRL+ARROW-DOWN: Add attribute or content above/below the current selection
- CTRL+DEL: Delete the current attribute or content
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.
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 Display 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 grouped in rule sets. For the example file there already exists the rule set "WebPages". Every rule set may contain multiple rules.
Conditions and display options of rules
Rules do contain one or more conditions (in most 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... Page" 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 described 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 certain parts of the data from 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
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 Attributes/Children".
This will result in also these elements being listed.
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.
The same can be achieved by holding down the ALT key and click left
By clicking with the left mouse button when CTRL is down, the entry clicked is added to the selection.
To move content, click on it or select it, then hold down CTRL and move the mouse wheel 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.