Jump to content

XML editor: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Not XML
Spankman (talk | contribs)
Line 48: Line 48:
* [http://www.conglomerate.org/ http://www.conglomerate.org/] Web page for Conglomerate editor
* [http://www.conglomerate.org/ http://www.conglomerate.org/] Web page for Conglomerate editor
* [http://kdewebdev.org/ http://kdewebdev.org/] Quanta Plus Web Development tool from KDE Web DEV
* [http://kdewebdev.org/ http://kdewebdev.org/] Quanta Plus Web Development tool from KDE Web DEV
* [http://www.xmlfox.com/ XMLFox] Freeware XML and XSD schema Editor.
* [http://www.xmlfox.com/ XMLFox] Freeware XML and XSD schema Editor for the DOTNET framework.
* [http://www.xmlmarker.com/ XML Marker] Free XML Editor with tree grid and text views (freeware).
* [http://www.xmlmarker.com/ XML Marker] Free XML Editor with tree grid and text views (freeware).
* [http://xml-copy-editor.sourceforge.net/ XML Copy Editor] Fast, free, open source XML editor
* [http://xml-copy-editor.sourceforge.net/ XML Copy Editor] Fast, free, open source XML editor

Revision as of 06:20, 3 May 2006

An XML editor is a markup language editor with added functionality to facilitate the editing of XML. This could be done in plain text in a text editor such as Vim, with all the code visible. Specific XML editors, however, have facilties like word-completion and menus and buttons for tasks that are common in XML editing, based on data supplied with DTD.

There are also graphical XML editors that hide the code in the background and present the content to the user in a more user-friendly format, approximating the rendered version. This is helpful for situations where people who are not fluent in XML code need to enter information in XML based documents such as time sheets and expenditure reports. And even if the user is familiar with XML, use of such editors, that take care of syntax details, is often faster and more convenient. These are often called WYSIWYG editors, but not all of them are WYSIWYG: graphical XML editors can be WYSIWYG (when they try to display the final rendering) or WYSIWYM (when they try to display the actual meaning of XML elements). Users often look for WYSIWYG XML editors when they don't understand that the goal of XML is to separate the meaning of the elements (which is supposed to be encoded in an adapted XML language) from the way they are displayed (which is supposed to be defined for instance in an XSL or CSS stylesheet). Also, sometimes the word "WYSIWYG" is used to mean "graphical", for editors that are not really WYSIWYG.

Text editors

Here is an example of edition in a text editor with syntax coloring:

editing an XML file in a text editor

The advantage of text editors is that they present exactly the information that is stored in the XML file. It is the best way to control the formatting of the file (such as indentations), to do low-level operations (such as a find/replace on element names) and to edit XML files without any schema or configuration file.

Graphical editors

Graphical editors are based on GUIs, are easier to use than text editors, and may not require knowledge of XML. When they are not WYSIWYG, they do not display the (or one of the) graphical end result of a document, but instead focus on conveying the meaning of the text. They use DTDs or XML schemas and/or configuration files to map XML elements to graphical components.

editing an XML file in a graphical editor

In the above example, the editor is using a configuration file to know that the TABLE element represents a table, the TR element represents a line of the table, and the TD element represents a cell of the table. It is using this information to display the table based on this structuring information, in order to makes editing easier.

Schema and configuration files information can also be used to ensure that users do not create invalid documents. For instance, in a text editor, it is possible to create a row with too many cells in the table, while this would not be possible with the above graphical user interface.

WYSIWYG editors

Finally, WYSIWYG editors let people edit files directly with the graphical end result. This may or may not be possible, depending on the transformation from XML into the end result.

Using a WYSIWYG editor effectively prevents users from creating documents with a meaning, because they only see a graphical rendering and will change the XML elements (and hence the meaning of the document) in order to get a different graphical result. For instance, someone creating a web page could use a H2 element (meaning: second level title) instead of H1 (meaning: first level title) because it looks smaller on their current display. In this case, they are not only changing the meaning of the title, but the result won't even be the same for everyone because the rendering depends on the browser used.

Usually WYSIWYG editors support CSS but not XSLT, because XSLT transformations can be very complex, and guessing what the user meant when changing the end result can be impossible.

editing an XML file in a WYSIWYG editor

In the above example, a stylesheet is used to color table cells in a particular way. For instance, even rows do not have the same background color as odd rows, in order to make reading easier.

While the advantage of editing the document while seeing the end result is obvious, the drawback is not. But the risk of editing a document in a WYSIWYG way is to lose sight of the meaning of the different elements. If the meaning of the elements are wrong, results of a different transformation with a different stylesheet might get very wrong. For instance, if someone adds some text above the table, is it the table title or is it not related to the table ? If some text shows in bold face on the first line of the table, does it mean it's the table header or not ? Depending on the interpretation, the result with a different stylesheet (for instance to print a document, publish it on the web, or search for values in specific XML elements) can be very different.

Lists of XML editors

XML editors