Exchanger XML Editor
- Page created by Daniel K. Schneider, 15 November 2010
- Contributors: Daniel K. Schneider x28, Vjollca Ahmeti x1, Antonella eng x1
- Last modified by Daniel K. Schneider, 20 July 2015
Exchanger XML editor is an XML editor. I use it in various course settings where I either teach XML or use XML - Daniel K. Schneider 2010 - 2015. As of nov. 2010, the last release was v.3.3.01 (June 2010). It is available through a "Google code" repository. It seems that the company who developed the initial version is inactive and that they made their code open source. This "new" free version includes the XSLT debuger, something that the free V3.2 version did not...
As of July 2015, Exchanger XML editor is still the best free general purpose XML code editor. It offers schema support and includes an XSLT debugger and a whole lot of editing tools that we will not describe here. Other free editors may better suit precise purposes such as DocBook editing.
- DTD/Schema aware editing
- Wellformedness checking and validation
- XSLT Support (including a good tracer/debugger)
- DTD/XSD/RNG conversion tools
- Xinclude resolver
- Multi-platfrom (Java-based).
This editor is quite well documented (press the Help item in the menu bar). Below we just will write down a few essential tricks.
2 XML editing
2.1 DTD-defined XML
Very important: Exchanger has a little bug that requires you to define a well-formed XML file with a correct header and an inserted root element before you start editing. This is a quite "normal requirement". But, then you must close this *.xml file and re-open it again in order to make the editor DTD aware. In other words, if you don't create this skeleton, then close and open it again, the editor will not help you with XML editing as described below.
A typical skeleton looks like this, i.e. it would include XML declaration on top, follow by a schema declaration and and inserted root element.
<?xml version="1.0"?> <!DOCTYPE recipe SYSTEM "cooking.dtd"> <recipe> </recipe>
Below is a screenshot of the V3.3. editor:
To insert an element:
- As in the screen shot above, select the Editing helper pane to the left by clicking on (*>) . Then (in the editing window) click on the element tag you wish to edit or put your cursor in a location between child element. The helper pane will then display available elements on which you can click to insert.
- Or, in the contents window press press Ctrl-T to insert an element.
- Or, pressing "<" in the editing window gives more options and you can do it in any place.
To insert an attribute:
- Click on a tag name of an element. Then click on an attribute on top of the helper pane to the left
- or position the cursor after the element name (but remain within the tag itself). Then press the space bar
The order of elements (works only with DTD's but not with XSD's) is shown in the top pane to the left. You may have to fiddle with options in the XMLmenu if your XSD Schema is not attached in the right way.
Soft wrapping (important for text-centric XML)
- Menu: View -> Editor Properties Select
2.2 XSD-defined XML
Editing a documented based on and XSD follows the same principle as using a DTD, however associating an XSD with a XML file is somewhat more tricky.
3 XSLT Transformation
When you develop an XSLT style sheet, it is important to verify that correct HTML (or whatever other kind of output) is being produced. To do so, you can use the built-in XSLT processor that is available through the Transform menu.
- Open your XML file (not the xslt file as many beginners do ....)
- Then use menu Transform->Execute Advanced XSLT...
This procedure allows to use a style-sheet processing declaration of your XML file, e.g. something like this:
<?xml version="1.0"?> <!DOCTYPE recipe SYSTEM "cooking.dtd"> <?xml-stylesheet href="cooking.xsl" type="text/xsl"?>
For output, either choose new document or file. Choose file, if you plan to validate the output
In addition (truly important !), it seems that only the Saxon 2.0 processor is working in the V3.3.1 edition. Therefore you must define the right processor. You can do this by clicking on the Processor button as shown in the figure below, but we rather suggest to change the global preferences in Menu file->Preferences; XML Tab. Saxon 2.0 is probably the best XSLT processor anyhow.
Of course, in other situations you may choose other options, e.g. you don't need to open the files in the editor, they don't even need to be on your computer.
For Mac users: in some cases, even if you opened the right document (xml), the XSLT transformation doesn't work (apparently after an incorrect installation) so try selecting Open document instead of Current document in Execute Advanced XSLT window, and choose the xml file you need to transform.
4 XSLT debugging
The included XML debugger can be used at two levels
- Beginners just can open it and have a look at the processing traces, i.e. understand what elements are dealt with by which templates and in what order. Also, the result (e.g. HTML) is displayed.
- Advanced users can insert breakpoints (right-click next to a number) and then inspect bindings.
To launch it:
- Menu Transform->XSLT Debugger
5 Schema development
The Schema menu allows:
- Validation of DTD, XSD and RNG. It is crucial to use this feature when you develop a schema.
- Schema conversion from XML, DTD or RNG to XSD
6 Installation tips
- Download at Google (code.google.com).
- Exchanger XML Editor (professional, no longer maintained ?)
- Read the Exchanger XML Editor article for details on how to install and how to use it.
- Last release: v.3.3.01 (June 2010). Re-tested and installed on Windows 7 64-bit.
- Overall, still the best free XML editor IMHO - Daniel K. Schneider 15:10, 20 September 2010 (CEST).
Exchanger V3.3.1, installed without problems under Windows 7 64 bit (oct. 2010/DKS)
6.2 Installation on Ubuntu 10.0 LTS
- Get xngr-editor.zip xngr-editor.zip a Zip file
- Unzip in an install directory, then run it with:
java -jar xngr-editor.jar &
Write a shell script like this (or better) for version 3.3.01 (Summer 2010)
#! /bin/bash cd /usr/local/xngr java -jar xngr-editor.jar &
For the older version 3.2 you had to:
#! /bin/sh cd /usr/local/exchanger java -jar lib/xngr-loader.jar &
6.3 Installation on Windows
We have been using this editor under Windows XP, VISTA, Win7 and Win8
The installer version worked on most configuration. In case it does not, you could install the "zip" version. I do it anyhow on most of my machines, since I don't like "windows" installation using the registry.
Also, in the past we had to write a short shell script to make it work. Contents of file xngr.cmd:
rem Change to the path where you extracted the zip cd c:\soft\xngr start javaw -jar lib\xngr-loader.jar
7.1 Opinion of DSchneider
Editing is fairly ergonomic, DTD-based XML editing support is ok, XSD-based XML editing support could be improved (does not display information about element structure). There are many additional tools (some useless for beginners but of interest to advanced users). So this is my best choice for a free structure editor.
Only major problem: It does not propose elements in the right order (DTD rules are displayed, but XSD no). This is a problem with almost all editors I have seen. An exception that does this better is Framemaker (an expensive word processor).
Addition (Feb 2007). I used this editor in a 8 weeks XML beginner's class and indeed it was a good choice. I also liked the XSLT support. There is a validator and editing support for major XSL and XSD elements. Also, I found out that one can format text (Menu Edit->XML->Format). This is crucial when confronted with ugly student productions :).
Xchanger was again updated on June 2010 (version 3.3). It still remains the best overal choice for teaching introductory XML (DTD,XSLT,XSD etc.). Only caveat: Make sure to change the XSLT processor option to Saxon 2.0 (the others won't work) - Daniel K. Schneider 15:10, 20 September 2010 (CEST).