To provide a user interface for a given XML language, Daxe needs the language definition (given with an XML schema) and a configuration file describing the user interface for the language. It works in the same way as Jaxe, but the config files use a different language. An XSLT stylesheet is available in the config directory to transform a Jaxe configuration file into a Daxe one.
Specifically, configuration files contain basic information about the XML language (a link to the schema and a list of root elements), saving options, menus (especially to insert the elements), display types for the elements, and all the strings used in the interface, depending on the user language.
They are located in Daxe's config directory, and their names end with "_config.xml".
When creating a new config file, the first thing to do is to define the corresponding XML language. This is usually done by specifying an existing XML schema. Schemas must use the W3C syntax (WXS), or the Relax NG one (in XML).
After defining the XML language, it is necessary to give Jaxe one or several possible root elements to use for new documents. The name of the element is specified for each possible root element.
Element tree under Language :
Document type definition, if a DTD must be specified in the document headers.
SchemaLocation
To save the location of the XML schema in XML documents.
Prefix to use for a given namespace. It is possible to specify several namespace prefixes.
Element tree under Saving :
Menus defined in config files are displayed above Daxe's text area, after the file and edit menus.
A main menu, possibly containing sub-menus.
A menu to insert an XML node at the cursor position. The node name and the node type (element by default) must be specified. It is also possible to specify a keyboard shortcut, with the corresponding key.
Menu to execute a function with its name. The only predefined function in Jaxe is jaxe.FonctionNormal, which is used to remove all the styles in a text area. Other functions can be added by extending Daxe.
Menu separator.
Element tree under Menus :
An essential feature in Daxe is the possibility to display and edit XML element in different ways, whatever their types in the XML schema. For instance, a table element can be displayed as a table, and an element linking to an image can be displayed as an image. The objective is to ease document editing, without losing of sight their semantics : elements will not be displayed as they will be seen in web pages or PDF documents, but simply with a user interface making edition easier and highlighting the meaning of the elements.
Specifies how an element will be displayed in Jaxe
A display parameter, depending on the display type (see below for a list).
Value suggested to the user when the schema does not limit authorized values.
Can be used to suggest attribute values.
Element tree under Display :
Type | Description | Display |
---|---|---|
division | Two bars extending to the window's right side, clearly separating large areas in the document. | |
area | Two tags and carriage returns, to separate areas smaller than with division. | |
block | A block hiding the start and end tags, as an alternative to division and area. Attributes are displayed on top, in a short or editable view, and the block can be collapsed with a button. | |
string | Two tags to identify a small string, without any carriage return. | |
empty | A single tag, typically for an empty element. | |
table | Table display allowing the use of XML elements inside the cells. Also handles the rowspan and colspan attributes to gather cells vertically and horizontally. | |
tr | Table row. | |
td | Table cell. | |
style | For use in the case (very rare if the XML language encodes the meaning as opposed to the presentation) where an XML element only conveys a style information. Displays the characters in the chosen style (bold, italic, ...), without any tag. An alternative is to use the string type, which can also use a style, but displays the tags. | |
file | Displays an image based on its path on the disk coming from an attribute of the XML element (to be defined). It is possible to copy/paste images and Daxe will automatically create the XML element and save the image file whenever possible, using the first element of type file. | |
symbol | Special character stored as a UNICODE character within the element tags. If no element has this type, users will still be able to insert UNICODE characters from a table. | ⇔ |
list | For an element representing a bulleted or ordered list. The sub-element must use the item type. The tags are displayed as for area, with a '+' button to create new items. | |
item | List item in a list displayed with the list type. Displayed with bullets or numbers, depending on the list type. | |
wlist | Displays a list with the default browser display for the HTML ul element. This provides a more WYSIWYG interface than list, because the list tags are hidden (which might also make it harder to edit the XML precisely). The witem type must be used for items. | |
witem | Must be used for items in a list using the wlist type. | |
simpletype | Displays an element having a simple value, in a small panel. Usable only for the elements with a simple type in the XML schema. The precise display (text field, menu or checkbox) and the validation are done based on the XML schema constraints. | |
equationmem | Displays the image of an equation. The equation can be edited by a simple click on the image, with a dialog showing at the same time the text of the equation (using a very simple syntax specific to Jaxe/Daxe) and the corresponding image. The text of the equation is store as an attribute, and the image is encoded in base64 and added as text inside the element. | |
equatexmem | This works in the same way as the previous type, but using a TeX syntax. | |
form | Displays an element and all its sub-elements as a form. Beware not to use this type with elements that could have an infinitely deep subtree ! Sub-elements can be displayed as fields with the field type, or with other types (using other types within a form is only possible with Daxe, not Jaxe). | |
field | Form field | see above |
anchor | This is used to display WYSIWYG links with the HTML a element. | |
hiddenp | Provides a WYSIWYG interface to paragraph elements. Tags are not displayed, and entering a newline where the paragraph element is allowed automatically triggers the insertion of a new paragraph. | |
hiddendiv | Hides elements such as the HTML div to provide a more WYSIWYG interface. A new menu appears in the contextual menu to remove a parent div. | |
stylespan | Normally used on an HTML span element, this makes Daxe use the element with this type to add style to text. Note that it is better to provide semantic elements rather than style ones like span. | |
hr | Displayed as a horizontal line, as for the HTML hr element. | |
br | Displayed as a line break, as the HTML br element. This display type might not play well with hiddenp, and should be avoided in general. |
Parameters can be specified for some display types, with the Parameter element under Element display.
Display types division and area can have a parameter specifying the name of the attribute to use as a title for the element display.
Display types file and symbol must have a parameter specifying the attribute with the file name.
Display types table must have parameters specifying the elements for the rows and the cells.
Display types style must have a parameter specifying the style.
Display types area and string can have a parameter specifying the style, a parameter with the font family, and a parameter with the font size.
Display types equationmem and equatexmem must have a parameter specifying the attribute to use for the equation text.
Here is a list of all the parameters:
type | parameter name | description |
---|---|---|
division and area | titleAtt | attribute for the title |
division, area, string and empty | visibleAttributes | displays all the attributes on the start tag (true|false) |
table | colspanAttr | attribute to merge columns |
table | rowspanAttr | attribute to merge rows |
table | alignAttr | attribute to align text |
wlist | type | type of list (ul|ol) (unordered/ordered) |
style, area and string | style | BOLD | ITALIC | SUPERSCRIPT | SUBSCRIPT | UNDERLINE | STRIKETHROUGH | FOREGROUND[###,###,###] | BACKGROUND[###,###,###] |
area and string | font | font family |
area and string | size | font size |
file | srcAtt | attribute with the file name |
file | chooser | when set to "true", the file chooser is used to select a file, from the XML file directory |
file | widthAtt | the name of the attribute with the width (in pixels) |
file | heightAtt | the name of the attribute with the width (in pixels) |
item | image1 | first bullet image |
item | image2 | second bullet image |
equationmem and equatexmem | textAtt | attribute with the equation text |
anchor | nameAtt | the name of the name attribute |
anchor | hrefAtt | the name of the href attribute |
hiddenp, hiddendiv and stylespan | styleAtt | the name of the CSS style attribute |
All the texts (also called strings) may have to be changed in the interface created with the configuration. Either to improve readability without having to change the schema, or to provide an interface in another natural language for the same schema. Texts may also have to be provided for a set of languages, so that users can edit the same documents, with the same Daxe configuration, but with an interface entirely in their native language.
For these reasons, the Strings element represents a set of strings for a given language and country, and it is possible to specify several in the same config file. On can use for instance language="pt" country="BR" for Brazilian Portuguese, or just language="en" so specify English without any precision about the country.
You may have noticed that the real config file XML elements have French names, even though you see them in English in Daxe and in this documentation. This is because the config file for config files is using these Strings elements to define titles to use for elements when the user's system language is English.
Short line to describe the configuration, displayed in the dialog to create new documents with Jaxe.
Strings associated to a menu, identified with its name
A title
A documentation
Strings associated to an XML element. Used to display the element, but also for this element's insertion menu if no string was defined for the menu.
A title to use for an element or attribute value
Strings associated to an attributes
Element tree under Strings :