Exchanger XML Editor

The educational technology and digital learning wiki
Jump to navigation Jump to search

Introduction

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 16:11, 15 November 2010 (CET).

As of November 2010, Exchanger XML editor is still the best free general purpose XML code editor. It offers schema support and includes an XSLT debugger. Other free editors may better suit precise purposes such as DocBook editing.

XML editing

To insert an element or attribute:

  • Select the Helper (*>) "pane to the left. 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, position the cursor after the element name and press the space bar

To display the order of elements (works only with DTD's but not with XSD's) in the top pane to the left. Select Menu->XML->Set Document properties. Untick "Location defined in document", then Tick "Use for Tag completion". I feel that this is an important feature. Too bad that it's sort of hidden away.

Soft wrapping (important for text-centric XML)

  • Menu (View -> Editor Properties)

XSLT Transformation

When you develop an XSLT stylesheet, 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.

I suggest to use "Execute Advanced ..." since it allows to use a style-sheet processing declaration of your XML file (click on "User Processing Instruction).

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.

XSLT Processor settings (important)

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
Screen shot of the Exchanger XSLT Debugger

Installation tips

Installation on Ubuntu 10.0 LTS

  1. Get xngr-editor.zip xngr-editor.zip a Zip file
  2. 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 &

Installation on Windows Vista

  • Installer did't work for me at some point (Vista professional). Maybe V 3.3. works, but I can't tell since I moved to Win 7.
  • I had to take the zip version (see above) and then write a 2-line shell script. 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


Opinions

  • 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). Still the best overal choice for teaching introductory XML (DTD,XSLT,XSD etc.) - Daniel K. Schneider 15:10, 20 September 2010 (CEST).