XMLmind XML Editor - Configuration and Deployment Hussein Shafie XMLmind Software XMLmind XML Editor - Configuration and Deployment Hussein Sha®e XMLmind Software

Publication date June 22, 2021

Abstract

This document describes how to customize and deploy XXE. Table of Contents

I. Con®guration guide ...... 1 1. Introduction ...... 3 2. Writing a con®guration ®le for XXE ...... 4 1. What is a con®guration? ...... 4 2. A con®guration for the "Simple Section" document type...... 4 3. Before writing your ®rst con®guration ...... 5 4. Anatomy of a con®guration ®le ...... 5 5. Specifying which con®guration to use for a given document type ...... 7 6. Associating a schema to the opened document ...... 7 7. XML catalogs ...... 8 8. Document templates ...... 9 9. CSS stylesheets ...... 9 9.1. Styling images ...... 9 9.2. Styling tables ...... 10 10. A speci®c tool bar ...... 11 10.1. Text style toggles ...... 12 11. Element templates ...... 13 12. A speci®c menu ...... 14 12.1. About the table editing command ...... 15 13. Speci®c keyboard shortcuts ...... 16 13.1. About macro commands ...... 17 14. Interactively resizing an image ...... 17 15. Miscellaneous con®guration elements ...... 18 16. Converting an XML document to other formats ...... 19 16.1. About process commands ...... 20 17. Packaging your con®guration for XXE add-on manager ...... 21 3. Using HTML4 tables or CALS tables in your own custom schema ...... 23 1. HTML4 tables ...... 23 1.1. HTML4 table editor command ...... 24 2. CALS tables ...... 25 2.1. CALS table editor command ...... 26 4. Customizing mouse and key bindings used by XXE ...... 27 1. Bindings speci®c to a document type ...... 27 2. Generic bindings ...... 28 5. Customizing an existing con®guration ...... 30 1. Adding a custom document template ...... 31 2. Replacing an existing document template ...... 31 3. Removing an existing document template ...... 32 4. Adding a custom CSS style sheet ...... 32 5. Replacing an existing CSS style sheet ...... 34 6. Removing an existing CSS style sheet ...... 34 7. Adding buttons to the tool bar ...... 34 8. Adding items to the menu ...... 35 9. Parametrizing the XSLT style sheets used in the Convert Document submenu ...... 35 10. Customizing the XSLT style sheets used in the Convert Document submenu ...... 38 11. Using a custom CSS style sheet to style the HTML ®les generated by the Convert Document submenu ...... 44 II. Con®guration reference ...... 48 6. Con®guration elements ...... 51 1. attributeEditor ...... 51

iii XMLmind XML Editor - Configuration and Deployment

2. attributeVisibility ...... 55 3. binding ...... 57 4. command ...... 68 4.1. About command names ...... 69 5. con®guration ...... 69 6. ...... 72 7. DTD ...... 72 8. detect ...... 73 9. directionalityFinder ...... 76 9.1. HTMLDirectionalityFinder, a con®gurable implementation of Direction- alityFinder ...... 78 10. documentResources ...... 80 11. documentSetFactory ...... 81 11.1. Bean properties ...... 82 12. elementTemplate ...... 83 12.1. Adding empty text nodes to your element templates ...... 86 12.2. Speci®cities of selectable="override" ...... 86 13. elementVisibility ...... 87 14. help ...... 89 15. imageToolkit ...... 90 16. include ...... 93 17. inclusionScheme ...... 94 18. linkType ...... 96 18.1. Using linkType to implement link navigation ...... 100 18.2. Using linkType to implement link validation ...... 101 18.3. Using linkType to de®ne custom, specialized, attribute editors ...... 102 19. menu ...... 103 19.1. Customizing a menu or a toolBar without rede®ning it from scratch ...... 104 19.2. Multiple menus ...... 109 20. newElementContent ...... 110 21. nodePathAttributes ...... 111 22. property ...... 112 23. parameterGroup ...... 113 24. preserveSpace ...... 114 25. relaxng ...... 114 26. saveOptions ...... 115 27. schema ...... 119 28. schematron ...... 120 28.1. Relationship between schematron and validateHook ...... 121 29. spellCheckOptions ...... 121 30. template ...... 124 31. toolBar ...... 125 31.1. Custom controls ...... 128 31.1.1. The TextStyleMenu custom control ...... 129 31.1.2. The TextStyleToggle custom control ...... 130 31.1.3. The ListTypeMenu custom control ...... 133 31.2. Multiple tool bars ...... 137 31.3. Adding con®guration speci®c tool bar buttons to the XXE GUI ...... 138 31.3.1. How does it work? ...... 138 31.3.2. Why specify div and span elements in a toolBar con®guration ele- ment? ...... 139 32. translation ...... 140

iv XMLmind XML Editor - Configuration and Deployment

33. validate ...... 141 34. validateHook ...... 142 35. viewSettings ...... 143 36. Custom con®guration elements ...... 145 III. Deploying XXE ...... 146 7. The XXE desktop application ...... 148 1. Dynamic discovery of add-ons ...... 149 1.1. Additional or alternative addon/ directories ...... 152 8. Deploying XXE using Java™ Web Start ...... 154 1. What is Java™ Web Start? ...... 154 2. Deploying XXE using Java™ Web Start, a step by step description ...... 154 9. Embedding XXE in a third-party Java™ application ...... 157 10. The deployxxe command-line tool ...... 158 1. Why use deployxxe? ...... 158 2. deployxxe reference ...... 158 Index ...... 162

v List of Figures

2.1. The "Simple Section" tool bar ...... 11 2.2. The "Simple Section" menu ...... 14 2.3. Resize handles around an image ...... 18 6.1. Ribbon of the XXE desktop application when no document is being edited ...... 138 6.2. Ribbon of the XXE desktop application when a DITA map is being edited ...... 138

vi List of Tables

6.1. Properties of the XInclude scheme ...... 95 6.2. TextStyleMenu properties ...... 129 6.3. TextStyleToggle properties ...... 131

vii List of Examples

6.1. DocBook 4 example ...... 85 6.2. Dynamic element template ...... 85 6.3. Simplest TextStyleMenu custom control ...... 129 6.4. Customizable TextStyleMenu custom control ...... 130 6.5. Simplest TextStyleToggle custom control ...... 132 6.6. ªActiveº TextStyleToggle custom control ...... 132 6.7. ªActiveº TextStyleToggle custom control showing a label in addition to an icon ...... 132 6.8. Simplest ListTypeMenu; may be used in the DITA Topic con®guration ...... 134 6.9. DocBook 5 ListTypeMenu ...... 135 6.10. XHTML 1.0 Strict ListTypeMenu; most complex speci®cation because the type of the list must be speci®ed using a CSS style ...... 136

viii Part I. Configuration guide Table of Contents

1. Introduction ...... 3 2. Writing a con®guration ®le for XXE ...... 4 1. What is a con®guration? ...... 4 2. A con®guration for the "Simple Section" document type...... 4 3. Before writing your ®rst con®guration ...... 5 4. Anatomy of a con®guration ®le ...... 5 5. Specifying which con®guration to use for a given document type ...... 7 6. Associating a schema to the opened document ...... 7 7. XML catalogs ...... 8 8. Document templates ...... 9 9. CSS stylesheets ...... 9 9.1. Styling images ...... 9 9.2. Styling tables ...... 10 10. A speci®c tool bar ...... 11 10.1. Text style toggles ...... 12 11. Element templates ...... 13 12. A speci®c menu ...... 14 12.1. About the table editing command ...... 15 13. Speci®c keyboard shortcuts ...... 16 13.1. About macro commands ...... 17 14. Interactively resizing an image ...... 17 15. Miscellaneous con®guration elements ...... 18 16. Converting an XML document to other formats ...... 19 16.1. About process commands ...... 20 17. Packaging your con®guration for XXE add-on manager ...... 21 3. Using HTML4 tables or CALS tables in your own custom schema ...... 23 1. HTML4 tables ...... 23 1.1. HTML4 table editor command ...... 24 2. CALS tables ...... 25 2.1. CALS table editor command ...... 26 4. Customizing mouse and key bindings used by XXE ...... 27 1. Bindings speci®c to a document type ...... 27 2. Generic bindings ...... 28 5. Customizing an existing con®guration ...... 30 1. Adding a custom document template ...... 31 2. Replacing an existing document template ...... 31 3. Removing an existing document template ...... 32 4. Adding a custom CSS style sheet ...... 32 5. Replacing an existing CSS style sheet ...... 34 6. Removing an existing CSS style sheet ...... 34 7. Adding buttons to the tool bar ...... 34 8. Adding items to the menu ...... 35 9. Parametrizing the XSLT style sheets used in the Convert Document submenu ...... 35 10. Customizing the XSLT style sheets used in the Convert Document submenu ...... 38 11. Using a custom CSS style sheet to style the HTML ®les generated by the Convert Doc- ument submenu ...... 44

2 Chapter 1. Introduction

XMLmind XML Editor (XXE for short) is an XML editor designed for production use. Unlike many other XML editors, its user interface does not allow to do simple things such as:

· Open an XML document in the editor and, after this, use a dialog box to associate a DTD and/or a style sheet to the newly opened document.

· Select a DTD or schema using a ®le chooser and then, use another dialog box to select the root element of a new document (conforming to the chosen DTD or schema).

The above features are useful if you muse with an XML ®le from time to time. They are almost never needed in production use, for example, writing a book ten hours a day.

Out of the box, XXE can be used to author XHTML, DocBook and DITA documents with a good per- sonal productivity.

But if you need to achieve excellent productivity for a group of users in your organization or if you need to use a proprietary DTD, W3C XML Schema or RELAX NG schema, then you©ll have to customize existing XXE con®gurations or you©ll have to write a custom con®guration for your proprietary schema from scratch.

In an organization, the task of writing a con®guration ®le for XXE is ideally performed by a single person, who belongs to the group of XML authors, but who is specially motivated by becoming the local guru.

· The local guru really needs to understand the job of the group of XML authors which will use XXE.

· The local guru really needs to be motivated because she/he will have to read tons of documentation: XXE documentation, but also many W3C standards such as XML, CSS, XPath, etc.

· The local guru does not need to be a programmer, or even a member of the IT staff.

If you don©t have a person with the pro®le of a local guru, you may consider hiring an external consultant for a few days.

3 Chapter 2. Writing a configuration file for XXE

1. What is a configuration?

A con®guration ®le is a declarative XML ®le which teaches XXE how to handle documents of a given type. Without an appropriate con®guration ®le, XXE is not of much use: the opened document is rendered using a tree view, it cannot be validated, schema-directed editing does not work, the user is limited to the most basic editing commands.

XXE is bundled with con®gurations for DITA, DocBook and XHTML. More con®gurations are available but they need the user to download and install the corresponding add-on (i.e. using menu item Options → Install Add-ons).

For the impatient, the most basic con®guration ®le looks like this:

-//XMLmind//DTD Example//EN